Whenever you open the Command Prompt in Windows you are taken to a default directory which is usually your Documents and Settings \ Username directory. Most of the time you navigate away from it because you need to access files that cannot be accessed from there.
I decided to go a step further and change the default Command Prompt directory to c:\windows\system32. That is my choice, you can set it to any directory that you want. To change the default Command Prompt directory open the Registry by pressing Windows R, typing regedit and hitting enter.
Navigate to the key HKEY_CURRENT_USER \ Software \ Microsoft \ Command Processor and search for the String Autorun in the left window. If that string is not existing yet create it. Double-click it afterwards and add the new directory path in the following way:
CD /d c:\windows\system32
Changes take effect immediately which means you can test right away. The default directory for the Command Prompt is changed before it is displayed which means that you already start in the new folder that you have selected.

Change the Print Spooler Directory
New Entry In Right Windows XP Start Menu
Windows Cannot Find Msconfig
Well I’m not sure if this hack was on ghacks allready, but to get a Shell-Context-Menu entry to open the command prompt in a choosen folder, just save this:
;start here
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\cmd]
@=”Open Command &Promt here…”
[HKEY_CLASSES_ROOT\Directory\shell\cmd\command]
@=”cmd.exe /k \”cd %L\”"
[HKEY_CLASSES_ROOT\Drive\shell\cmd]
@=”Open Command &Promt here…”
[HKEY_CLASSES_ROOT\Drive\shell\cmd\command]
@=”cmd.exe /k \”cd %L\”
; end here
into a file (commandprompt.reg) and add it to your registry.
No it has not yet Obi, thanks for mentioning it.
Nice hack! That’s really clever :)
no this does not work
Hey anubhav, that does work.
Thanks Martin.
anubhav, it does work. You’ve got to create the key if it isnt there, create it as a string then edit it to the path.
xp wont let me add to reg.
can not import, not a reg script, only import binary reg. files.
then do it manually
sorry im pretty newb. whats this thing that obi posted do? if its complicated then either dont worry or link me to something. thx.
I actually had a different starting directory and wanted to get back to c:\
This regedit definitely worked for me.
Does anyone know how to do it from the command prompt w/o regedit though?
>Does anyone know how to do it from the command prompt w/o regedit though?
Well, cmd help points to those registry settings… If you really want to play around it you can just make .bat (.cmd) file that runs console and goes to directory needed. Something like this:
cmd /k cd “c:\”
Hi Rarst
You can open command prompt from a drive by shift right clicking the drive and clicking on the open command prompt here on the popup menu
Kent
Hi,
thank you so much
I dont c autorun???
Ummmm i dont c autorun…can anybody help me, im so nooob at this kinda stuff.>=|
@ Rj
When here in the registry editor …
HKEY_CURRENT_USERSoftwareMicrosoftCommand Processor
… right-click in the white space, if there is no variable named “Autorun” and click “New” in the menu which was opened after the right-click. Name the variable “Autorun”. Select “String” from the choices of the type of variable and click OK (or whatever button there is that signals to add the variable). You should then see a variable called “Autorun” in the margin. Double-click on it and in the “Value:” textbox, put …
CD /d X:Y
… where X is your current drive and Y is the folder you want the default prompt to be. If you do not understand this, just ask and it shall be given unto.
- magicyte
thats so easy to tweak!
Nice thing.Thanks……….