re: Question about 'Run a Shortcut from the Command Prompt'
Sunday, June 27, 2010 at 4:53 am Windows XP Annoyances Discussion Forum
Posted by brunob75
(1 messages posted)
The 'issue' here is not related specifically to shortcuts (.lnk files) or batch files.
This is the way the start command is designed to work, and it is exactly the same
when used from the command line or when trying to launch other executable file types.
The same goes when trying to leverage data file type associations to open them from
the command line (or batch file).
As has been mentionned above in this page, the first argument to the 'start' command
is the desired "Title" for the new window, enclosed between double quotes.
So when using the start command followed by an enquoted string and nothing else,
it will launch a new cmd.exe (command prompt) with the provided string as "title".
This can be seen right there in the new window title bar.
This is what happens when the full pathname of the target file includes space chars,
and you MUST double quote it.
To avoid this, you need to provide a title argument before the pathname of the file
you want to launch. This "Title" string can be empty, but the argument needs to be
there.
For instance, this command will launch IE just fine :
start "" "c:\Program Files\Internet Explorer\iexplore.exe"
While this one instead will not :
start "c:\Program Files\Internet Explorer\iexplore.exe"
The only thing specific to executable files (defined in your system's %PATHEXT% environment
variable) is that the file extension technically needs not be provided.
To avoid any possible confusion though, and potentially create a security exposure,
it is a good idea to always explicitly provide it in the command.
|
All messages in this thread [show all]
 |  |  | re: Question about 'Run a Shortcut from the Command Prompt' (brunob75: Sun, Jun 27, 2010, 4:53 am) |
| |
| |
| |
Return to the Windows XP Discussion Forum
|
|