I am trying to run a simple xcopy command at machine shutdown. When I execute the command via cmd , everything works as expected. However when I paste it in a batch file and try to run it , I encounter errors. Here is the command:
FOR /D %d in (*) DO xcopy /S /I /y /exclude:exclude.txt %d V:\SUBFOLDER\%d
The error I get is : "unexpected exclude.txt " I tried surrounding the file name with quote marks but it is didn't solve the issue. What am I doing wrong? Thank you for your help!