%~dp0是什么意思,它是如何工作的?

蓝咒 提交于 2020-10-05 00:32:18

问题:

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
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!