Solved

Saving windows command prompt history to a file

Posted on 2012-12-20
2
452 Views
Last Modified: 2013-01-15
Hello,
Is possible to save windows command prompt history to a file?
I'm going to work in sqlplus and would like to save in a log file all commands that were used and executed.
Example, would like to save all commads executed in a 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.
0
Comment
Question by:miyahira
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 38710196
Use the SQLPlus command spool:

spool C:\commands.log
[some commands]
spool off

Open in new window


Note that this will output the results of the queries you run as well. I can't recall if there's a way to prevent that, but I think there is.

http://www.adp-gmbh.ch/ora/sqlplus/spool.html
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 38717092
You could also run it as a batch file like:
start "" thebatchfile.bat >>"Log File.log"
0

Featured Post

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
OfficeMate Freezes on login or does not load after login credentials are input.
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question