Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
dos key logs what happens in the shell, now what happens within programs that are launched. – Zoredache Dec 20 '12 at 17:37

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


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.