<p>Im searching a tool which allows me to specify some folders as "bookmarks" and than access them on the commandline (on Windows XP) via a keyword. Something like:</p>

<pre><code>C:\&gt; go home
D:\profiles\user\home\&gt; go svn-project1
D:\projects\project1\svn\branch\src\&gt;
</code></pre>

<p>I'm currently using a bunch of batch files, but editing them by hand is a daunting task. On Linux there is <a href="http://www.skamphausen.de/software/cdargs/" rel="noreferrer">cdargs</a> or <a href="http://kore-nordmann.de/blog/shell_bookmarks.html" rel="noreferrer">shell bookmarks</a> but I haven't found something on windows.</p>

<hr>

<p>Thanks for the Powershell suggestion, but I'm not allowed to install it on my box at work, so it should be a  "classic" cmd.exe solution.</p>

[{'answer_id': 32007, 'author': 'Matt Hamilton', 'author_id': 615, 'author_profile': 'https://Stackoverflow.com/users/615', 'pm_score': 2, 'selected': False, 'text': '<p>With PowerShell you could add the folders as variables in your profile.ps1 file, like:</p>\n\n<pre><code>$vids="C:\\Users\\mabster\\Videos"\n</code></pre>\n\n<p>Then, like Unix, you can just refer to the variables in your commands:</p>\n\n<pre><code>cd $vids\n</code></pre>\n\n<p>Having a list of variable assignments in the one ps1 file is probably easier than maintaining separate batch files.</p>\n'}, {'answer_id': 32012, 'author': 'Espo', 'author_id': 2257, 'author_profile': 'https://Stackoverflow.com/users/2257', 'pm_score': 1, 'selected': False, 'text': '<p>Without Powershell you can do it like this:</p>\n\n<pre><code>C:\\&gt;set DOOMED=c:\\windows\nC:\\&gt;cd %DOOMED%\nC:\\WINDOWS&gt;\n</code></pre>\n'}, {'answer_id': 32014, 'author': 'Stephen Darlington', 'author_id': 2998, 'author_profile': 'https://Stackoverflow.com/users/2998', 'pm_score': 0, 'selected': False, 'text': '<p>Environment variables?</p>\n\n<pre><code>set home=D:\\profiles\\user\\home\nset svn-project1=D:\\projects\\project1\\svn\\branch\\src\n\ncd %home%\n</code></pre>\n\n<p>On Unix I use this along with popd/pushd/cd - all the time.</p>\n'}, {'answer_id': 32019, 'author': 'Andrew', 'author_id': 1948, 'author_profile': 'https://Stackoverflow.com/users/1948', 'pm_score': 6, 'selected': True, 'text': '<p>What you are looking for is called DOSKEY </p>\n\n<p>You can use the doskey command to create macros in the command interpreter.  For example:</p>\n\n<pre><code>doskey mcd=mkdir "$*"$Tpushd "$*"\n</code></pre>\n\n<p>creates a new command "mcd" that creates a new directory and then changes to that directory (I prefer "pushd" to "cd" in this case because it lets me use "popd" later to go back to where I was before)</p>\n\n<p>The $* will be replaced with the remainder of the command line after the macro, and the $T is used to delimit the two different commands that I want to evaluate.  If I typed:</p>\n\n<pre><code>mcd foo/bar \n</code></pre>\n\n<p>at the command line, it would be equivalent to:</p>\n\n<pre><code>mkdir "foo/bar"&amp;pushd "foo/bar"\n</code></pre>\n\n<p>The next step is to create a file that contains a set of macros which you can then import by using the /macrofile switch.  I have a file (c:\\tools\\doskey.macros) which defines the commands that I regularly use.  Each macro should be specified on a line with the same syntax as above.</p>\n\n<p>But you don\'t want to have to manually import your macros every time you launch a new command interpreter, to make it happen automatically, just open up the registry key </p>\n\n<p>HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Command Processor\\AutoRun and set the value to be doskey /macrofile "c:\\tools\\doskey.macro".  Doing this will make sure that your macros are automatically predefined every time you start a new interpreter.</p>\n\n<p>Extra thoughts:\n - If you want to do other things in AutoRun (like set environment parameters), you can delimit the commands with the ampersand.  Mine looks like: set root=c:\\SomeDir&amp;doskey /macrofile "c:\\tools\\doskey.macros"\n - If you prefer that your AutoRun settings be set per-user, you can use the HKCU node instead of HKLM.\n - You can also use doskey to control things like the size of the command history.\n - I like to end all of my navigation macros with \\$* so that I can chain things together\n - Be careful to add quotes as appropriate in your macros if you want to be able to handle paths with spaces in them.</p>\n'}, {'answer_id': 32026, 'author': 'seanyboy', 'author_id': 1726, 'author_profile': 'https://Stackoverflow.com/users/1726', 'pm_score': 2, 'selected': False, 'text': '<p>With just a Batch file, try this... (save as filename "go.bat")</p>\n\n<pre><code>@echo off\nset BookMarkFolder=c:\\data\\cline\\bookmarks\\\nif exist %BookMarkFolder%%1.lnk start %BookMarkFolder%%1.lnk\nif exist %BookMarkFolder%%1.bat start %BookMarkFolder%%1.bat\nif exist %BookMarkFolder%%1.vbs start %BookMarkFolder%%1.vbs\nif exist %BookMarkFolder%%1.URL start %BookMarkFolder%%1.URL\n</code></pre>\n\n<p>Any shortcuts, batch files, VBS Scripts or Internet shortcuts you put in your bookmark folder (in this case "c:\\data\\cline\\bookmarks\\" can then be opened / accessed by typing "go <em>bookmarkname</em>"</p>\n\n<p>e.g. I have a bookmark called "stack.url". Typing go stack takes me straight to this page. </p>\n\n<p>You may also want to investigate <a href="http://www.launchy.net/" rel="nofollow noreferrer">Launchy</a></p>\n'}, {'answer_id': 32035, 'author': 'Cheekysoft', 'author_id': 1820, 'author_profile': 'https://Stackoverflow.com/users/1820', 'pm_score': 2, 'selected': False, 'text': '<p>Another alternative approach you may want to consider could be to have a folder that contains symlinks to each of your projects or frequently-used directories. So you can do something like</p>\n\n<pre>\ncd \\go\\svn-project-1\ncd \\go\\my-douments \n</pre>\n\n<p>Symlinks can be made on a NTFS disk using the <a href="http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx" rel="nofollow noreferrer">Junction</a> tool</p>\n'}, {'answer_id': 33681, 'author': 'Adam Mitz', 'author_id': 2574, 'author_profile': 'https://Stackoverflow.com/users/2574', 'pm_score': 1, 'selected': False, 'text': '<blockquote>\n<p>Crono wrote:</p>\n<blockquote>\n<p>Are Environment variables defined via &quot;set&quot; not meant for the current session only? Can I persist them?</p>\n</blockquote>\n</blockquote>\n<p>They are set for the current process, and by default inherited by any process that it creates.  They are not persisted to the registry.  Their scope can be limited in cmd scripts with &quot;setlocal&quot; (and &quot;endlocal&quot;).</p>\n'}, {'answer_id': 36609494, 'author': 'DieterDP', 'author_id': 1436932, 'author_profile': 'https://Stackoverflow.com/users/1436932', 'pm_score': 3, 'selected': False, 'text': '<p>I was looking for this exact functionality, for simple cases. Couldn\'t find a solution, so I made one myself:</p>\n\n<pre><code>@ECHO OFF\nREM Source found on https://github.com/DieterDePaepe/windows-scripts\nREM Please share any improvements made!\n\nREM Folder where all links will end up\nset WARP_REPO=%USERPROFILE%\\.warp\n\nIF [%1]==[/?] GOTO :help\nIF [%1]==[--help] GOTO :help\nIF [%1]==[/create] GOTO :create\nIF [%1]==[/remove] GOTO :remove\nIF [%1]==[/list] GOTO :list\n\nset /p WARP_DIR=&lt;%WARP_REPO%\\%1\ncd %WARP_DIR%\nGOTO :end\n\n:create\nIF [%2]==[] (\n  ECHO Missing name for bookmark\n  GOTO :EOF\n)\n\nif not exist %WARP_REPO%\\NUL mkdir %WARP_REPO%\nECHO %cd% &gt; %WARP_REPO%\\%2\nECHO Created bookmark "%2"\nGOTO :end\n\n:list\ndir %WARP_REPO% /B\nGOTO :end\n\n:remove\nIF [%2]==[] (\n  ECHO Missing name for bookmark\n  GOTO :EOF\n)\nif not exist %WARP_REPO%\\%2 (\n  ECHO Bookmark does not exist: %2\n  GOTO :EOF\n)\ndel %WARP_REPO%\\%2\nGOTO :end\n\n:help\nECHO Create or navigate to folder bookmarks.\nECHO.\nECHO   warp /?          Display this help\nECHO   warp [bookmark]      Navigate to existing bookmark\nECHO   warp /remove [bookmark]  Remove an existing bookmark\nECHO   warp /create [bookmark]  Navigate to existing bookmark\nECHO   warp /list           List existing bookmarks\nECHO.\n\n:end\n</code></pre>\n\n<p>You can list, create and delete bookmarks. The bookmarks are stored in text files in a folder in your user directory.</p>\n\n<p><strong>Usage</strong> (copied from current version):</p>\n\n<p>A folder bookmarker for use in the terminal.</p>\n\n<pre><code>c:\\Temp&gt;warp /create temp     # Create a new bookmark\nCreated bookmark "temp"\nc:\\Temp&gt;cd c:\\Users\\Public    # Go somewhere else\nc:\\Users\\Public&gt;warp temp     # Go to the stored bookmark\nc:\\Temp&gt;\n</code></pre>\n\n<p>Every warp uses a pushd command, so you can trace back your steps using popd.</p>\n\n<pre><code>c:\\Users\\Public&gt;warp temp\nc:\\Temp&gt;popd\nc:\\Users\\Public&gt;\n</code></pre>\n\n<p>Open a folder of a bookmark in explorer using <code>warp /window &lt;bookmark&gt;</code>.</p>\n\n<p>List all available options using <code>warp /?</code>.</p>\n'}]
['https://Stackoverflow.com/questions/32003', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1462/']