How to? retain command history across reboot?

Apr 28, 2021
1
0
I all need from your products is to have the ability to retain the command history in both CMD and PowerShell.

I found it to difficult to achieve this simple goal with you product. I am using Windows 10 and I have installed the following list of products and I am using them in trial mode:

Take Command v27 (64-bit installer)
TCC v27 (64-bit installer)
CMDebug v27 (64-bit installer)
TCC-RT v27 (64-bit installer)

In linux, every time I start a terminal window, my command is recorded to my .bash_history file. Can your product provide a similar solution? Is there a simple step-by-step guide to do that?

Thanks
 
From the help file (HISTORY);
If you need to save your command history at the end of each day's work, you might use the first of these commands in your TCSTART.BTM or other startup file, and the second in TCEXIT.BTM:

if exist c:\histfile history /r c:\histfile

history > c:\histfile

This restores the previous history list if it exists, and saves the history when TCC exits.

TCC can also load and save the history list automatically if you use the History File configuration option.

See History File for the automatic method.

Joe
 

samintz

Scott Mintz
May 20, 2008
1,511
18
Solon, OH, USA
The HISTORY command will save the command history for TCC. It does nothing for CMD or Powershell which are their own products. While pretty much any console app can run in a TakeCommand tabbed window, Tcmd itself has no control over the apps own command line history.
For CMD, the DOSKEY command is used for command history, although I don't know how to reload old history.
For Powershell, the Get-History command will return the list of commands you've entered. And Add-History can be used to restore it.

TakeCommand has the "Command Input" window where you can keep a list of commonly used commands. And it lets you copy and paste to that window. From the help:
Take Command Command Input Window
The Command Input window allows you to create and edit commands before sending them to the active tab window. This is not limited to entering something at the command prompt; you can feed strings anywhere a console app is expecting input. You can scroll back to previous lines, edit, and reexecute them. The Command Input window also has full undo/redo (up to 31 levels). You can automatically save the contents of the Command Input window when Take Command exits, and reload it when Take Command starts (see Auto Save File).
 
May 20, 2008
11,520
102
Syracuse, NY, USA
This product will not (cannot) help you with the command history of CMD or PowerShell.

If you use a global command history (and other lists) and SHRALIAS, whatever lists SHRALIAS is guarding (history, dirhistory, alias, function) are saved at logout/shutdown.

PowerShell has a built-in save/reload command history mechanism. Google for ".ps_history" for more information.
 
May 20, 2008
11,520
102
Syracuse, NY, USA
For Powershell, the Get-History command will return the list of commands you've entered. And Add-History can be used to restore it.
Scott, I have these lines in my profile.ps1.

Code:
#$HistoryFilePath = Join-Path ([Environment]::GetFolderPath('UserProfile')) .ps_history
#Register-EngineEvent PowerShell.Exiting -Action { Get-History | Export-Clixml $HistoryFilePath } | out-null
#if (Test-path $HistoryFilePath) { Import-Clixml $HistoryFilePath | Add-History }

They are commented out but I still have a working history save/reload history mechanism in PowerShell. Do you know what's going on?
 
Jun 2, 2008
359
4
I am using Windows 10 and I have installed the following list of products and I am using them in trial mode:

Take Command v27 (64-bit installer)
TCC v27 (64-bit installer)
...

No need for TCC separately because Take Command comes with its own TCC.
 
Similar threads
Thread starter Title Forum Replies Date
Phileosophos TCMD 10.00.67 does not retain window positions Support 10
Z CMDDebug - TCC unknown command Support 2
F Edit command Support 1
rconn News Take Command / TCC / CMDebug / TCC-RT 28.02.17 Support 0
old coot LEAVE appears to affect command-line arguments Support 11
J VDESKTOP command Support 3
old coot tee command cancels colors Support 33
Dmitry L. Kobyakov How to? How to remove the record of the old version of the Take Command? Support 9
D Can alias pass parameters to for command? Support 3
samintz How to? Search for %(command) in Help? Support 1
T VIEW only works from command line Support 14
rconn News Take Command / TCC / CMDebug / TCC-RT v28 Released Support 0
T Take Command 28: Lua reports version 5.4.0 (5.4.3 expected) [SOLVED] Support 1
Jay Sage WAD Possible Bug With OPTION Command With @FILE Support 5
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.24 uploaded Support 0
J Take command does not start on Windows 10 Support 3
vefatica `Back quotes` - command line vs. batch file Support 5
Jay Sage WAD Failure of Alias Command with /Z Option Support 14
Phileosophos Is there any way to open the Take Command options dialog from the command line? Support 8
Phileosophos Command-line Editing Shortkeys That Fail Support 6
fpefpe How to? free (internal) command Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.23 uploaded Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT v27.01 Build 22 Uploaded Support 0
Jay Sage Bug With Flow Control and/or Command Grouping Support 2
GermanDirk How to? EVENTLOG Command with simple User Rights not functional Support 4
Jay Sage Take Command Is Too Fast! Support 4
Jay Sage Comparison of IF with Command Group and IFF Support 6
D Open Windows 10 Photos app from command line Support 11
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.21 uploaded Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.20 uploaded Support 0
U Can not get/start Take Command gui Support 1
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.19 Support 0
S Increasing Font Point Size in Command Tabs Support 2
mfarah Fixed The DATE command produces the wrong error message. Support 1
vefatica Command name mix-up Support 3
FreezerBurnt "Missing SETLOCAL" when initializing Visual Studio Command Prompt. Support 9
E How to? Closing desktop created by DESKTOP command Support 10
rconn News Take Command / TCC / CMDebug / TCC-RT v27.0.18 Support 0
K Take Command fox XP? Support 7
Joe Caverly Documentation Replace internal command with LIBRARY command Support 0
fpefpe How to? command echo in title line/bar Support 2
U Command help on file names Support 5
vefatica Command line DO with no closing parenthesis? Support 9
vefatica Command history search is off Support 7
H How to? How can I say "if the command separator is not ~ then setdos /C~" Support 8
N Command execution slows down in TCC Prompt after a while Support 6
R Long commands retrieved from command history have blank line when wrapped Support 20
jpeni Take Command Language Examples Support 1
rconn News Take Command / TCC / CMDebug / TCC-RT 26.02.41 Uploaded Support 0
fpefpe winfr command Support 4

Similar threads