问题:
I find %~dp0 very useful, and I use it a lot to make my batch files more portable. 我发现%~dp0非常有用,我使用它来使我的批处理文件更具可移植性。
But the label itself seems very cryptic to me... What is the ~ doing? 但标签本身似乎很神秘,我...什么是~做什么? Does dp mean drive and path? dp是指驱动器和路径吗? Does the 0 refer to %0 , the path to the batch file that includes the file name? 0是否指向%0 ,包含文件名的批处理文件的路径?
Or it is just a weird label? 或者它只是一个奇怪的标签?
I'd also like to know if it is a documented feature, or something prone to be deprecated. 我还想知道它是否是一个记录的功能,或者是一些容易被弃用的东西。
解决方案:
参考一: https://stackoom.com/question/L7am/dp-是什么意思-它是如何工作的参考二: https://oldbug.net/q/L7am/What-does-dp0-mean-and-how-does-it-work
来源:oschina
链接:https://my.oschina.net/stackoom/blog/4317330