In Win2k or XP cmd.exe
"the Prompt" runs with the default directory of:
C:\Documents and Settings\[LogonUserName]
This behavior you see is by design, but here's a workaround:
1. Click Start -> Run
2. Type "Regedit" (without quotes) and click OK
3. In the Registry Editor go to
double-click the "AutoRun" value
4. Add the data: cd [path]
where [path] is the path to the folder you want the command prompt to open at.
"cd \" - will open in the root of the current drive
"cd c:\windows" - will open in the Windows folder
"cd %WinDir%\System32" - will open in the System32 folder
5. Click OK and close the Registry Editor
The command prompt should now open at the specified folder.
This will affect all users of the system. If you wish to make this settings different for different users, simply add the 'AutoRun' value to the following key instead:
This runs a standard Change Directory (CD) command automatically on launching the cmd. This can be adapted to run other commands. For example would cause the prompt to open in the Windows directory and produce a listing of the contents:
"cd %windir% && dir"
Note: The entries in 'AutoRun' are ignored if the command prompt is opened with a /D switch: