Here's a quick little trick that some may or may not know.
CMD.EXE has some switches of it's own that don't get used too often unless you spend a lot of time scripting batch files etc.
The one we care about for this blog post is the"/K" switch
Definition -/k : Carries out the command specified by string and continues.
So let's say you have Ncat installed and you want to have a quick desktop shortcut to launch it, you would set it up as follows:
1. Right-click the desktop and choose NEW > Shortcut and the following window will appear
2. Enter "cmd.exe" into the location and click NEXT
3. Type in the desired shortcut name, in this case: Ncat 5.21
4. Once you have clicked Finish, you should see something like the following on the desktop. Right-click the icon and choose Properties
5. In the Properties pop-up window, you should see the following
6. In the "Target:" field append " /k ncat -h" with out the quotes as shown below
7. Also you'll want to usually run built-in command line tools from the systems directory, in this case: SYSTEM32 So append it to the path "Start in:" like shown below.
This can be used for any command line application. You can get more creative to include more complex switch and command arguments to the shortcut if there is a particular process you want to launch easily. If you go too far with it, you might as well start batch scripting though. ;)
Go Team CMD-LINE!
No comments:
Post a Comment