Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible to save DOS command prompt history to a file?

I'm going to work in sqlplus and would like to save all commands that were used and executed in a log file.

Example, I would like to save all DOS commads executed in a DOS session:

C:\> sqlplus /nolog
sql> connect / as sysdba
sql> select * from v$version;
etc, etc

I tried to do before: doskey /history >> C:\commands.log

But it does not record anything. I'm in a Windows Server 2008 64 bits.

share|improve this question
    
Try a different directory, that you create like C:\temp. UAC can kill that redirection silently when saving to a "system" directory, including root of C. –  HopelessN00b Dec 20 '12 at 17:31
1  
dos key logs what happens in the shell, now what happens within programs that are launched. –  Zoredache Dec 20 '12 at 17:37

1 Answer 1

Start Powershell, use the transcript functionality.

Start-transcript Initializes a transcript fi le and then creates a record of all subsequent actions in the PowerShell session. Use the following syntax:
Start-Transcript [[-path] FilePath] [-force] [-noClobber] [-append]

Stop-transcript Stops recording actions in the session and finalizes the transcript. Use the following syntax: Stop-Transcript

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.