Avatar of E=mc2
E=mc2
Flag for Canada asked on

How can I default the command promt in Windows 10 to the C drive?

When I open a command promt, it defaults to the S drive, not the C drive.
My scripts are therefore not working the way they were designed..

How can I configure the default to be C, instead of S for the command prompt in Windows 10 pro?
Thank you.
Windows OS

Avatar of undefined
Last Comment
Sandeep

8/22/2022 - Mon
Edward Pamias

In the command prompt shortcut just add..

C:\Windows\System32\cmd.exe /k "cd c:\"
ASKER CERTIFIED SOLUTION
pjam

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Lee W, MVP

You could also modify your scripts so they start in the correct place - that's the better long term solution since you'll have to do this otherwise on any system you copy the scripts to/user that uses them.
Sandeep

Open regedit and browse to this path

HKEY_CURRENT_USER\Software\Microsoft\Command Processor
Create new string vale named Autorun. Set its value to cd /d C:\. (Here whatever path you mention, next time on wards your command prompt will open in that path only)

Run cmd again.

Try your luck, I tried and it worked.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck