DOS batch script to open file explorer
It's not terrible as it is, but you're right to wonder if there's a better way.  As you noticed already, it would be nice to keep the associations between the abbreviation and the corresponding directory in one place.

Fortunately, there's a very slick way to to that.  First, create a text file file that contains just the file associations:

e.txt

db      D:\Alex\Dropbox
bin     D:\Alex\Scripts\Bin


e.cmd

@echo off
FOR /F "tokens=1,2" %%i in (e.txt) do if "%~1" EQU "%%i" ( explorer "%%j" &amp; EXIT /B )
ECHO Invalid target %target%.


This uses a relatively obscure feature of the FOR command that allows us to parse a file.  You can read more about that by executing HELP FOR from the command line.

Naturally, in the real version, you'd want to specify the full path to the e.txt file.

Allowing spaces in directory names

If you might have spaces in the directory names, you can do so with little additional effort.  For example, we can use = for the delimiter in the text file so that each line now looks like this:

sp=D:\Alex\Scripts\Advanced Scripting


Now just modify the script so that we specify the delimiter.  To do that change the part of the line that says "tokens=1,2" to read "tokens=1,2 delims==" and that's it.