Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? retain command history across reboot?

Apr
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
 
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).
 
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.
 
Sorry, I mis-understood.

I run CMD and PowerShell from TCC, which saves those commands in the TCC history.

Joe
 
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?
 
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

Back
Top