assuming you remain on the same drive, i.e. no
cd D:\somedir\ needed.
In my case, C: holds system files, but all work is on D:
2 parts. first set some working directories, using a batch file.
let's say localprofile.cmd. You can have multiple ones of these, just run them as needed.
now use another command file to move around, based on those environment variables you just set.
if %1.==. set | findstr wd
if %1==1 cd %wd1%
if %1==2 cd %wd2%
if %1==3 cd %wd3%
if %1==4 cd %wd4%
if %1==5 cd %wd5%
if %1==6 cd %wd6%
And a bit of a sample use:
wd by itself is supposed to show me the list of bookmarked directories. It works, but not sure why I am getting this "unexpected cd" message.
cd was unexpected at this time.
Regular .cmd batches
Aside from directory navigation, you can create a foo.cmd somewhere on your PATH and it can act much as an alias. Remember, unlike Linux/OSX shells, cmd files can affect environment variables and the session, without needing to source them.
I have a cdbin.cmd to navigate me, for example:
And this is a pseudo-grep grep.cmd
findstr -n %1 %2
in action (whatever sort /+2 /+10 means)
D:\home\work\fb440.dumper>grep class *.py | sort /+2 /+10