在Windows中,命令cd / d%〜dp0是什么意思 [英] What does it mean by command cd /d %~dp0 in Windows
本文介绍了在Windows中,命令cd / d%〜dp0是什么意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可以帮助我理解命令 cd / d%〜dp0
及其用途。再次使用dos命令
Can someone please help me to understand the command cd /d %~dp0
and its purposes. Again dos command is below
cd /d %~dp0
请帮助我获得它的意义。
Please help me to get the meaning of it.
推荐答案
解剖它。有三个部分:
-
cd
- 这是更改目录命令。 / li>
-
/ d
- 此开关使cd
更改驱动器和目录一旦。没有它,你必须做cd%〜d0& cd%〜p0
。 -
%〜dp0
- 可以进一步分为三个部分:
cd
-- This is change directory command./d
-- This switch makescd
change both drive and directory at once. Without it you would have to docd %~d0 & cd %~p0
.%~dp0
-- This can be dissected further into three parts:
-
%0
- 这代表批处理脚本的第零个参数。 -
%〜0
-〜
-
%dp0
/ code> -
d
和p
有扩展的修饰符。d
强制添加驱动器号,p
添加完整路径。
%0
-- This represents zeroth parameter of your batch script. It expands into the name of the batch file itself.%~0
-- The~
there strips double quotes ("
) around the expanded argument.%dp0
-- Thed
andp
there are modifiers of the expansion. Thed
forces addition of a drive letter and thep
adds full path.
li>
这篇关于在Windows中,命令cd / d%〜dp0是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文