Why the following failure of %~d0 to return the batch file\'s drive letter S: when CALL quotes the name of the batch file?
S:\\!DJ DAP>type test.b
"%~dpi" also fails when you are listing files but the working directory is a different folder, or drive. It shows the working directory and not the path of the files.
"%~dpi"
I think the solution here might be to get the %~d0 before changing drive.
%~d0