Reputation: 1882
I would like to start cmd.exe
from batch file and execute command, but:
If I use start cmd.exe /k
e.g. „net use“
– it executes command behind /k. - and it gives me default path - i would like to change it.
But how to run cmd.exe
with another path as it is set and execute command behind /k
?
I start cmd.exe - i have - c:\users\xxxx
What do i have to if i would like to chande it? E.g. c:\tools\Script\...
How to write batch like this?
Upvotes: 0
Views: 179
Reputation: 37589
Use the start /d
parameter, e.g.
start "" /d"c:\documents and settings" cmd /k
see start /?
for more help.
Upvotes: 2
Reputation: 340
Try using
cd "pathname"
to get to the correct Path. For Example:
cd c:\tools\Script
you can also show all folders by using the command
dir
Furthermore the cmd.exe is automatically used if you try to execute a .bat file I believe.
But for changing the normal path used you can edit the settings as shown in this picture:
For more funcitons you could look here: http://www.computerhope.com/overview.htm
Upvotes: 1