[英]Issue with a variable in my batch script
我希望我的脚本:
以下代码有什么问题? ECHO
语句只是打印Your directory is set to
; DIR
声明按预期工作。
@ECHO OFF
SET custompath = "C:\Users\%1"
ECHO Your directory is set to %custompath%
DIR %custompath%
这是=
周围的空间。
@ECHO OFF
SET custompath="C:\Users\%1"
ECHO Your directory is set to %custompath%
DIR %custompath%
查看这篇文章 。
就个人而言,我会这样做:
@ECHO OFF
SET /P "custompath=Enter a custom windows path: "
ECHO Showing contents of directory ^"%custompath%^"
DIR /b "%custompath%"
pause
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.