echo for /f "delims=" %%%i in ^(^'DIR /A -H /B^'^) do set "check^=^^!check^^!,"%%%i"" >> Uninstall.cmd
Results in
for /f "delims=" %%i""
Original Code I'm trying to echo into Uninstall.cmd
for /f "delims=" %%i in ('DIR /A -H /B') do set "check=!check!,"%%i""
Can anyone help me figure out how to get that line of code to be escaped fully so that it can be outputted to a file?
If you don't have delayed expansion enabled
echo for /f "delims=" %%%%i in ('DIR /A-H /B') do set "check=!check!,"%%%%i""
If you have delayed expansion enabled, the exclamation points needs to be escaped
echo for /f "delims=" %%%%i in ('DIR /A-H /B') do set "check=^!check^!,"%%%%i""
BUT, if the code is executed inside a block, the closing parenthesis needs also to be escaped
if 1==1 (
echo for /f "delims=" %%%%i in ('DIR /A-H /B'^) do set "check=!check!,"%%%%i""
:: OR
echo for /f "delims=" %%%%i in ('DIR /A-H /B'^) do set "check=^!check^!,"%%%%i""
)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다