By using the command from a folder in D: drive
for /f \"delims=\" %%d in (\'cd\') do set pathdrv=%%d echo %pathdrv%
I get \"d:\\some fol
Drive letter:
%CD:~0,1%
Full drive name (incl. colon):
%CD:~0,2%