Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know I can change the command prompt to startup on C:\ rather than F:\Documents And Settings or wherever. But I was wondering if it's possible to set bookmarks or some other command that allows me to switch to locations.

For example, my Python projects have a long (about 7 subdirectories) address (think that's the word), and as such it takes a while to cd to them. What I would like to do is something like gotodirectory PythonProjects , and have it cd to where I have specified this, be it C:\WINDOWS or F:\Games\Steam\steamapps\common\some game\some game data\some more game data.

share|improve this question
up vote 3 down vote accepted

Put the below in a batch file called "gotodirectory", place that file somewhere in you path.

Then use as follows -

gotodirectory sys

The below batch also support changing to a different partitions.

Of course you can also add other commands.

@echo off
if "%1"=="sys" (
    cd /d C:\WINDOWS\System32
    goto :EOF
if "%1"=="home" (
    cd /d C:\Cygwin\home
    goto :EOF
if "%1"=="work" (
    cd /d C:\wwwroot
    goto :EOF
share|improve this answer
This is a rather neat solution. Thanks! :D – The Communist Duck Jan 4 '11 at 19:12
Since The Duck mentioned he is using Windows XP, using cmd.exe features would make the script much shorter. For one, you can force cd to change drive letters with /d option. (Using pushd would work nicely too.) Second, goto :EOF makes the explicit :end label unnecessary; there also is exit /b. Third, command grouping - either using ( ) or & - allows you to remove the rest of labels. (Feel free to revert the edit.) – grawity Jan 4 '11 at 21:46

Create a batch file and keep it in a directory contained within the default path.

As an example - to get to F:\Games\Steam\steamapps\common\some game\some game data\some more game data

cd "F:\Games\Steam\steamapps\common\some game\some game data\some more game data"

Save that as gotosteam.bat or any name you prefer and you're all set.

share|improve this answer

You can change the properties of C:\WINDOWS\system32\cmd.exe or create a shortcut to it and specify what directory you want it to start in (and even assign it a shortcut key).

share|improve this answer

set an environment variable:

% set GD_PYTHONPROJECTS=C:\There\And\There

then use it like


how to set environmet variables permanently check out

Set Permanent Environmental Variable in Windows XP

(you can set environment variables permanently via the gui as well, they are stored in there registry anyway)

share|improve this answer

Yet another answer:

"Cmd prompt here" context menu for windows explorer.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .