Changing default startup directory for command prompt in Windows 7

后端 未结 23 1987
情深已故
情深已故 2020-11-30 19:50

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 Promp         


        
相关标签:
23条回答
  • 2020-11-30 20:19

    HKEY_CURRENT_USER\Software\Microsoft\Command Processor

    string: Autorun value: cd /d %~dp0

    all bat files will run from the bat file location

    0 讨论(0)
  • 2020-11-30 20:20

    I think the easiest way is to make a cmd shortcut, then change the shortcut's "Start in" directory to the one you want to start with.

    described_image

    0 讨论(0)
  • 2020-11-30 20:20

    changing shortcut under Windows System on 8.1 worked for me - another thing I found is that 'Start In:' WORKS when Advanced -> Run as admin is UNCHECKED, however, if CHECKED, it does not work

    0 讨论(0)
  • 2020-11-30 20:22

    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.

    0 讨论(0)
  • 2020-11-30 20:23

    Use Windows Terminal and configure a starting directory. Partial settings.json:

    {
        // Make changes here to the cmd.exe profile.
        "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
        "name": "Command Prompt",
        "commandline": "cmd.exe",
        "hidden": false,
        "startingDirectory": "C:\\DEV"
    },
    
    0 讨论(0)
提交回复
热议问题