I have a shortcut on my desktop which opens a command prompt with many arguments that I need. I set the 'start in' field to d:\ and it works as expected (the prompt starts in d:). When I choose Advanced -> run as administrator and then open the shortcut, it starts in C:\Windows\System32, even though I have not changed the 'start in' field. How can I get it to start in d:\?
What to Know. Type cmd into the search bar to open the command prompt. Shift + right click in a window, then click Open PowerShell Window here to access the PowerShell interface. Open the folder you wish to access, then type cmd into the folder path at the top of the window to open a command prompt within the folder.
You can open cmd as an administrator by searching for it in the Windows search bar located in the bottom left corner of the desktop screen. Then, right-click on Command Prompt and select Run as administrator.
To do this, right-click in an empty space in File Explorer or the desktop. Then, go to New > Shortcut. ...then click Next. This is telling Windows to go into the system files and run the Command Prompt executable.
If you use the /k argument, you can add a single line to execute a change drive and change directory. For instance:
C:\Windows\System32\cmd.exe /k "d: & cd d:\storage"
Using &
you can string together many commands on one line.
Edit: You can also change drive with the cd command alone "cd /d d:\storage"
. Thanks to Adam Mitz for the comment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With