Unfortunately even the above isn't enough if you have more than one logical drive.

By default the cd command sets the current directory on the current drive if no drive letter is specified. However, if a drive letter is specified (as it is by %L), then CD changes the path on the specified drive (not necessarily the current drive).

To always open the DOS prompt at the correct location on the correct drive, use the following command:

cmd "cd /d %L"

The "/d" switch tells the CD command to change drive to the drive specified in the given path if it isn't already the current drive.