1

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.

5 Answers5

3

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
)
grawity
  • 501,077
bryan
  • 8,528
  • 4
  • 30
  • 42
1

set an environment variable:

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

then use it like

% cd %GD_PYTHONPROJECTS%

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)

akira
  • 63,447
1

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

f:
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.

Sparx
  • 1,775
1

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).

martineau
  • 4,573
0

Yet another answer:

http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx

"Cmd prompt here" context menu for windows explorer.

horatio
  • 3,719