Guillaume_fr Posted May 3, 2005 Share Posted May 3, 2005 Hello,When I launch cmd.exe on my XP SP2 (via Start | Run), the current directory is my Home Directory; I get this : Microsoft Windows XP [version 5.1.2600] © Copyright 1985-2001 Microsoft Corp. D:\Documents and Settings\Guillaume>How can I set up Windows to open cmd.exe in another directory (C:\ or anything else) ?Thanx, Guillaume. Link to comment Share on other sites More sharing options...
baywatch Posted May 3, 2005 Share Posted May 3, 2005 hi guillaumehere do you casn find the answers.http://www.petri.co.il/add_command_prompt_...ws_explorer.htm Link to comment Share on other sites More sharing options...
oioldman Posted May 3, 2005 Share Posted May 3, 2005 @baywatch - That URL is bad.@Guillaume_fr - Also, it is done via the SET HOMEPATH option.if you open the command box and type SET then hit return.What is your homepth, and change as needed. Link to comment Share on other sites More sharing options...
Guillaume_fr Posted May 3, 2005 Author Share Posted May 3, 2005 I have HOMEDRIVE=d: HOMEPATH=\Documents and Settings\GuillaumeIf I make > set HOMEDRIVE="C:"> set HOMEPATH="\"The next time I'll launch cmd.exe my HOMEDRIVE and HOMEPATH will be "d:" and "\Documents ..."So, how can I make my changes persistants ?And won't there have any other effects ? Link to comment Share on other sites More sharing options...
maxXPsoft Posted May 3, 2005 Share Posted May 3, 2005 Heres what I use to make the path in the Dir it executes on.This gives you right click on all Files/Folders and DOS HERE appears. Click it and opens the cmd prompt with path in dir of containing. That Microsoft one is useless to me.Windows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\*\shell\cmd]@="DOS HERE"[HKEY_CLASSES_ROOT\*\shell\cmd\command]@="cmd.exe \\\"%1\\\""[HKEY_CLASSES_ROOT\Directory\shell\cmd]@="DOS HERE"[HKEY_CLASSES_ROOT\Directory\shell\cmd\command]@="cmd.exe /k \"cd %L\\\""[HKEY_CLASSES_ROOT\Directory\shell\cmd]@="DOS HERE"[HKEY_CLASSES_ROOT\Directory\shell\cmd\command]@="cmd.exe /k \"cd %L\\\""[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\cmd]@="DOS HERE"[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\cmd\command]@="cmd.exe /k \"cd %L\\\"" Link to comment Share on other sites More sharing options...
maxXPsoft Posted May 3, 2005 Share Posted May 3, 2005 BTW if you right click on a file on the desktop it will give you what you had. Anywhere else its the actual pathE:\_beta.microsoft.com>C:\UnattendXP> Link to comment Share on other sites More sharing options...
Guillaume_fr Posted May 3, 2005 Author Share Posted May 3, 2005 maxXPsoft, I'm already using it (And it works).I'd like to be on C:\ when opening cmd.exe Link to comment Share on other sites More sharing options...
maxXPsoft Posted May 3, 2005 Share Posted May 3, 2005 Hmm I tried cmdinit.bat but no joy to do that. I'm not sure then a way to get it there. You could use that above and just click the C: drive and click Dos Here. I getC:\> Link to comment Share on other sites More sharing options...
spiritpyre Posted May 13, 2005 Share Posted May 13, 2005 this probably doesn't help but using /K parameter you can set the directory when you call cmdcmd.exe /k cd "C:\" opens cmd pointed to C:\although if you always want cmd to point to C:\ and you use a shortcut to call cmdyou could just put that in the shortcut? just an idea Link to comment Share on other sites More sharing options...
rubyquyen Posted May 14, 2005 Share Posted May 14, 2005 Hello,When I launch cmd.exe on my XP SP2 (via Start | Run), the current directory is my Home Directory; I get this : Microsoft Windows XP [version 5.1.2600] © Copyright 1985-2001 Microsoft Corp. D:\Documents and Settings\Guillaume>How can I set up Windows to open cmd.exe in another directory (C:\ or anything else) ?[HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor]"AutoRun"="C: && cd \\"Voilà Link to comment Share on other sites More sharing options...
Zxian Posted May 16, 2005 Share Posted May 16, 2005 [HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor]"AutoRun"="C: && cd \\"Voilà <{POST_SNAPBACK}>That should read:[HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor]"AutoRun"="C: && cd \"Note the single backslash. Otherwise you get an error (surprise...). Thanks for this though! Very nice!Cheers! Link to comment Share on other sites More sharing options...
rubyquyen Posted May 16, 2005 Share Posted May 16, 2005 Note the single backslash. Otherwise you get an error (surprise...). Thanks for this though! Very nice!Yes, single backslash if you enter the value directly into the registry. Mine is extracted from a .reg file, so double backslash are required. Link to comment Share on other sites More sharing options...
Yzöwl Posted May 16, 2005 Share Posted May 16, 2005 What about this?REG ADD "HKLM\SOFTWARE\Microsoft\Command Processor" /v AutoRun /d "%%SystemDrive%%" /for in reg format[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor]"AutoRun"="%SystemDrive%" Link to comment Share on other sites More sharing options...
rubyquyen Posted May 16, 2005 Share Posted May 16, 2005 What about this?REG ADD "HKLM\SOFTWARE\Microsoft\Command Processor" /v AutoRun /d "%%SystemDrive%%" /for in reg format[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor]"AutoRun"="%SystemDrive%"<{POST_SNAPBACK}>That sounds good, except that if you want C:\mydir as default, but your system is on D:, that won't work Link to comment Share on other sites More sharing options...
Yzöwl Posted May 16, 2005 Share Posted May 16, 2005 That sounds good, except that if you want C:\mydir as default, but your system is on D:, that won't work None of the examples given to date used C:\mydir. In fact if you want C:\mydir, your example(s) will not work either.The original questioner also only askedI'd like to be on C:\ when opening cmd.exeSince most users C: drive is also the %SystemDrive%, I gave that as an alternative, because in that scenario you don't need the && cd etc..If you would like to explain the probability of someone installing their system on D: and running the cmd shell, very likely located at D:\WINDOWS\system32 or D:\WINNT\system32 to access root at C:, which will very likely belong to another OS! (How many people create a 'data' drive as C: and then install the OS to D:)In your case, (as given in your quote above), all you should need would be[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor]"AutoRun"="cd /d c:\\mydir"or in a case where you have spaces in your chosen path. (The additional quotes may not be necessary if you have command extensions enabled)[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor]"AutoRun"="cd /d \"c:\\my dir\""By the way, if anyone is testing these without having first backed up the key, to return to the default setting use this[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor]"AutoRun"="" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now