1

How do I make a Command Prompt shortcut to open a different directory?

Currently, to navigate to the directory I want, I must open Command Prompt and type

C:\Users\me>cd ..\..\repos\RepoSet\UnfortunatelyLongNameAndSimilarToOtherRepos



I use this repo all the time, so I would like Command Prompt to open to this directory right away.

Note that I don't want to open a file, or execute any command other than cd. I just want to open the directory to my repo.

I am using Windows 10 if that makes a difference.

Problem with command line in windows has an answer by @Dave that seems to be what I want, but I don't know where to place the file he mentions.

1
  1. Create a file called mydir.text
  2. Place the file here: C:\Users\me\CmdFiles
  3. The contents of the file should read

    @set path=%path%;c:\utils @cd C:\repos\RepoSet\UnfortunatelyLongNameAndSimilarToOtherRepos @cmd.exe

  4. Edit the Path environment variable by navigating here Start -> Edit the system environment variables -> Environment Variables -> System variables -> click on Path -> Edit -> Add the path C:\repos\RepoSet\UnfortunatelyLongNameAndSimilarToOtherRepos under the list of paths.

The file contents are the same that @Dave's answer provided in Problem with command line in windows, but with more context that a new user would need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.