Testing if folder exist when there are spaces in a path
Posted: 17 Apr 2008 01:41
I am using following logic, but it fails if there are spaces in INIT_DIR variable (I use nul test to avoid errors when copying):
When quotes are used "%INIT_DIR%Images\nul" then nothing is found...
Code: Select all
if exist %INIT_DIR%Images\nul (
mkdir "%OUT_DIR%Images"
xcopy /y "%INIT_DIR%Images" "%OUT_DIR%Images" >> %LOG% 2>&1
if ERRORLEVEL 1 (
GOTO ERROR
)
)
When quotes are used "%INIT_DIR%Images\nul" then nothing is found...