tech gurus please help

Status
Not open for further replies.

microcontroller

Solid State Member
Messages
10
when we type cmd in the 'run' box and press enter the command prompt opens up and by default C:\> (or) d:\> is shown.

can we change that default path to the path of our choice?

thank you
:)
 
from http://www.rk-net.com/XP/cmd-path.htm

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
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor
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:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor

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:

"cmd /D"
 
Status
Not open for further replies.
Back
Top Bottom