If a commandline program is started out of the Windows-Explorer then only a black window pops up for a moment. Why? A commandline program expects commandline parameters. Without parameters the program writes an error message into the console (the black window) and ends, which also closes the console window. What's the point?
The plan is to start the commandline program from an existing console. Since the console stays open after the progam end you can read its output. You get a console by pressing the Windows-Key + R. In the execute dialog you enter CMD.
If you enter here for instance FORMAT then the FORMAT.COM executable file is started. Because of the missing parameters it writes an error message and ends. If you enter FORMAT /? it writes information about its expected command line parameters.
Behind the FORMAT command there is the executable file FORMAT.COM located in the folder C:\Windows\System32. It is not necessary to enter the full path to start it because the folder C:\Windows\System32 part of the evironment variable PATH. Windows looks in all folders of this variable for executable files. If you add for instance the folder C:\Tools to this variable and put your 3rd party commandline programs there, then you can start them without entering the full path each time. This is very handy but not necessary.
With Win+R you get the execute dialog - here you write the commandline. In the following examples I use my tool RemoveDrive. If you have the folder where the RemoveDrive.exe is located in the PATH variable then it's enough to enter just RemoveDrive, otherwise it must be entered with its full path:
For calling frequently used commandlines it's helpful to create a link for each variant. These links can be placed on the desktop, the shortcut bar or any other place.
Here you can define a hotkey too but this works only if the link is located on the desktop, in the shortcut bar or in the start menu.
If the path contains spaces then they must be enclosed by quotes. Sample:
"C:\Program Files\Tools\RemoveDrive.exe" Z:
|