Solved

Saving windows command prompt history to a file

Posted on 2012-12-20
2
444 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I had a question today where the user wanted to know how to delete an SSL Certificate, so I thought that I would quickly add this How to! Article for your reference. WHY WOULD YOU WANT TO DELETE A CERTIFICATE? 1. If an incorrect certificate was …
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
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…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…

726 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