For /f processing filename with spaces

我的梦境 提交于 2019-11-30 17:22:28

Try adding the usebackq option:

for /f "usebackq delims=" %%i in ("%RF_PROPERTIES%") do (          
  echo %%i
)

Explanation from the output of for /?:

usebackq - specifies that the new semantics are in force, where a back quoted string is executed as a command and a single quoted string is a literal string command and allows the use of double quotes to quote file names in file-set.

Using usebackq is a good idea - but you actually have to use them :

for /f "usebackq delims=" %%i in ( `dir "%RF_PROPERTIES%" /s /b` ) do (
  echo %%i
)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!