在Windows中,命令cd / d%〜dp0是什么意思 [英] What does it mean by command cd /d %~dp0 in Windows

查看:1272
本文介绍了在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.

推荐答案

解剖它。有三个部分:


  1. cd - 这是更改目录命令。 / li>
  2. / d - 此开关使 cd 更改驱动器和目录一旦。没有它,你必须做 cd%〜d0& cd%〜p0

  3. %〜dp0 - 可以进一步分为三个部分:
  1. cd -- This is change directory command.
  2. /d -- This switch makes cd change both drive and directory at once. Without it you would have to do cd %~d0 & cd %~p0.
  3. %~dp0 -- This can be dissected further into three parts:

  1. %0 - 这代表批处理脚本的第零个参数。

  2. %〜0 -

  3. %dp0 - d p 有扩展的修饰符。 d 强制添加驱动器号, p 添加完整路径。

  1. %0 -- This represents zeroth parameter of your batch script. It expands into the name of the batch file itself.
  2. %~0 -- The ~ there strips double quotes (") around the expanded argument.
  3. %dp0 -- The d and p there are modifiers of the expansion. The d forces addition of a drive letter and the p adds full path.

li>

这篇关于在Windows中,命令cd / d%〜dp0是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆