I try to create script with for loop to move file to sub folder.
At the beginning, I work with CMD
then I copy command to .bat
file and run it.
The result is nothing happens.
Why the same command on CMD
works but run from file not ?
Here is my command.
@echo off
setlocal enableDelayedExpansion
SET FOL=J:\test
SET ENDNUM=2
for /l %x in (1, 1, %ENDNUM%) do (
md "%FOL%/0%x/subfolder"
move /Y "%FOL%\0%x\*" "%FOL%\0%x\subfolder"
)