Code: Select all
set BackupFileDir=BackupFiles
if not exist %BackupFileDir% mkdir %BackupFileDir%
for %%x in (A1 B2 C3) do (
echo %%x >>Log.log
set MyFolder=%%x
echo %MyFolder% >>Log.log
set ActualDiffFolder=%BackupFileDir%\%MyFolder%
mkdir %ActualDiffFolder%
)
pause
Am getting the error that mkdir failed.
When I logged out, I found that while logging %%x is got the Correct Value
But MyFolder which is assigned the same value as %%x is not logging anything.
That means, no parameters are passed for mkdir
The log file is like this
Code: Select all
A1
ECHO is on.
B2
ECHO is on.
C3
ECHO is on.
Is there any issue with assigning variables inside for loop?