Changing default startup directory for command pro

2019-01-08 06:31发布

How do I change default startup directory for command prompt in Windows 7?

I usually do the following to start command prompt from C:\

  WIN-R (Run Prompt)
  cmd /K cd C:\

I want to do the following to start command prompt from C:\

  WIN-R (Run Prompt)
  cmd

18条回答
我想做一个坏孩纸
2楼-- · 2019-01-08 06:40

On windows 7:

  1. Do a search for "cmd" on your Windows computer
    1. right-click cmd and left click "Pin to start menu" (Alternatively, right-click cmd - click copy and then paste to your desktop )
    2. right-click the cmd in your start menu or on your desktop (depending on choice 2 above) - left click properties
    3. inside the "start in" text box paste the location of your default start directory
    4. Press Apply and OK

Every time you click on the cmd in your start menu or your desktop shortcut, the CMD will open in your default location

查看更多
来,给爷笑一个
3楼-- · 2019-01-08 06:41

type

cmd.exe /k cd c:/

in a text file and save as cmd.bat Clicking this file does the trick. You can pin it to the start menu as well.

To start in a partitioned drive (e.g. D), use

cmd.exe /k d:
查看更多
【Aperson】
4楼-- · 2019-01-08 06:43

On Windows Start Menu, right click on Command Prompt.

Click on "Properties".

"Command Prompt Properties" dialog box opens.

Edit the field "Start in " to a location where you want to start the command prompt.

Example: Chand %HOMEDRIVE%%HOMEPATH% to D:\PersonalPrograms.

Next time when you start command prompt the start up directory will be D:\PersonalPrograms

查看更多
聊天终结者
5楼-- · 2019-01-08 06:44

Keep the opening of the command prompt clean. Avoid editing the registry key and adding an Autorun, it may come back to bite you.
Create a simple batch file and save it in the C:\Windows or C:\Windows\System32 folder. I call mine !.bat (exclamation mark). It has the following commands:

@echo off c: cd \ cls whoami

It goes to the folder where I need to work, clears the screen and tells me what security context I'm in.

查看更多
我想做一个坏孩纸
6楼-- · 2019-01-08 06:46

regedit worked great. HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\Command Processor, all you have to do is change the AutoRun key value, which is already set to wherever you are currently getting dumped into to a new value in the format of:

cd /d <drive:path>

for c:\, that would be cd /d c:\
for junk, that would be cd d/ c:\junk

its very simple, even a novice thats never used regedit should be able to figure it out. if not, go to the c:\prompt and just type in regedit, then follow the path to the key.

查看更多
叛逆
7楼-- · 2019-01-08 06:47

Make a shortcut pointing to cmd.exe somwhere (e.g. desktop) then right-click on the copy and select "properties". Navigate to the "Shortcut" menu and change the "Start in:" directory.

查看更多
登录 后发表回答