[英]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.