0xC0000005
January 19th, 2006, 11:32 AM
According to the documentation for cmd.exe multiple commands can be specified by enclosing each with quotes and seperating them by &&.
If I run cmd.exe (Start/Run...) like this:
cmd /K path
I get a display of the path variables (/K means keep the command window open).
If I run cmd.exe like this:
cmd /K dir
I get a directory listing.
So, how do I run both commands with one call? From the documentation I would assume like this:
cmd /K "path" && "dir"
But instead of both commands running I get the error message:
'dir" && "path' is not recognized as an internal or external command, operable program or batch file.
Note that I am trying to develop an application to do cmd.exe processing from a Windows program and this is a simplified example of the problem that is easy to reproduce.
Can anyone tell me how to execute both "path" and "dir" with a single call to cmd.exe?
If I run cmd.exe (Start/Run...) like this:
cmd /K path
I get a display of the path variables (/K means keep the command window open).
If I run cmd.exe like this:
cmd /K dir
I get a directory listing.
So, how do I run both commands with one call? From the documentation I would assume like this:
cmd /K "path" && "dir"
But instead of both commands running I get the error message:
'dir" && "path' is not recognized as an internal or external command, operable program or batch file.
Note that I am trying to develop an application to do cmd.exe processing from a Windows program and this is a simplified example of the problem that is easy to reproduce.
Can anyone tell me how to execute both "path" and "dir" with a single call to cmd.exe?