CMD: failure of %~d0 when CALL quotes the name of the batch file

后端 未结 4 2184
遥遥无期
遥遥无期 2021-01-03 02:43

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         


        
4条回答
  •  渐次进展
    2021-01-03 03:08

    "%~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.

    I think the solution here might be to get the %~d0 before changing drive.

提交回复
热议问题