Console - A Shell For CMD.EXE

By Chris at March 12, 2010 09:55
Filed Under: General

I discovered this neat little open source application called Console that is effectively a shell for cmd.exe in Windows.  The reason I found this application was because SQL*PLUS that comes with the Oracle 11g client tools is command line/prompt only.  One of the rather annoying behaviors that cmd.exe has is the inability to easily copy and paste.  Console solves that problem and a whole lot more that I didn't realize I had.

 

Console's features are described as having "multiple tabs, text editor-like text selection, different background types, alpha and color-key transparency, configurable font, different window styles."  Now I have not utilized all these features yet, but the text editor-like text selection is very handy.  The multiple tabs feature is also quite nice.

 

Shortly after getting Console I created a shortcut to load Console and run SQL*PLUS.  First I opened Console's settings (Edit > Settings) and created a tab called SQLPLUS where I set the startup directory for my most common SQL script.  For the shortcut, I used the following:
"C:\Program Files (x86)\Console2\Console.exe" -t SQLPLUS -r "/k sqlplus"
The command line arguments I used were -t which tells Console which tab to use and -r to run a command.  I wanted it to use the SQLPLUS tab that I had previously configured under Settings.  The -r argument was a little tricky because when you use cmd.exe as your shell for Console, running programs needs to be preceeded with a /k which is why you see it before sqlplus.

 

I also created a shortcut that loads Console, runs SQL*PLUS, logs into an instance, and runs a SQL script automatically.  To do this I added my login credentials and the path to the SQL script after the sqlplus command.  It looks something like this "/k sqlplus user/pass@instance @runme.sql".