I am trying to move certain groups of files using wildcards to a folder that is created by the group’s filename. The names of the files are stored in “events.txt”.My batch file is running uptil the last line. It is displayed that my syntax is not correct.
echo off
for /F "tokens=*" %%A in (events.txt) do call :makemove %%A
pause
exit
:makemove
set f=%1
set file=%f:~0,-4%
md X%file%
set dest=C:\Users\sony\Desktop\X%file%
move /y "C:\Users\sony\Desktop\*%file%*.*" "%dest%"
Seems like there are whitespace characters after
line.
This causes the last line of your script evaluate to
and messes paths up.