運行下面批處理文件中的目錄名稱空間/(/ F 「delims =」 不工作)
@echo off
setlocal enableDelayedExpansion
set "targetlocation=C:\Users\myself\Documents\FOLDER WITH BLANK SPACES\"
for %%f in (!targetlocation!*) do echo %%f
pause
打印:
C:\Users\myself\Documents\FOLDER
WITH
BLANK
Press any key to continue . . .
我試圖實現以下變化,但它無法運行(見下文源)
for f/ "delim=" %%f in (!targetlocation!*) do echo %%f
batch file for loop with spaces in dir name
'嘗試在%%˚F' – jeb