I have two windows batch files: a.bat and b.bat.
b.bat is on the D: drive and is in my path
a.bat is on the E: drive and has something like the following in it:
call b.bat
echo %thedrive%
b.bat has something like the following in it:
IF %~d0==D: (
SET %thedrive=testdrive
) ELSE (
SET %thedrive=livedrive
)
The problem is that %~d0 is getting the drive letter that b.bat is on and not the drive that the calling (a.bat) batch file is on.
How do I get the drive the calling batch file is on?