Can I create a shortcut to a Windows directory?

If you want to open that folder in Windows Explorer, you can either:

  1. Create a shortcut (.lnk file) to a folder (by right clicking > New > Shortcut in Windows Explorer or on your desktop) then drop that shortcut somewhere in your path.
  2. Create a batch file like this:

    cd "c:\Documents and Settings\etc\etc"
    start .
    

    then save it as VS08P.bat and put it somewhere in your path.

If you want to jump to it in your command prompt, see Phoshi's answer.


Use the mklink command. From the command-line:

C:> mklink /D VS08P c:\Documents and Settings\[My ID]\My Documents\Visual Studio 2008\Projects

You will now have c:\VS08P that points to your Visual Studio directory above.


I will add to the 'create a simple batch' cacophony, with a twist. You can create a simple batch, but put a switch in side, such that you can use it to navigate to variety of favorite dirs:

@echo off
GOTO %1
:VS08P
cd c:\Documents and Settings\[My ID]\My Documents\Visual Studio 2008\Projects
GOTO END
:music
cd "C:\Documents and Settings\[My ID]\My Documents\My Music"
GOTO END
:downloads
cd C:\shared\downloads
GOTO END
:logs
cd C:\[project path]\logs
GOTO END
:END

You can call it go.bat, and you can use it for all your favorite locations Your friends will think you are really cool because you can just type go logs on the commandline and you are magically taken to your logs directory. You will still need to append the dir within which this bat is saved to your PATH.