Windows Batch file to move X number of files from folder to folder

前端 未结 3 1287
没有蜡笔的小新
没有蜡笔的小新 2021-01-14 15:48

I\'m trying to use a batch file to move files in blocks of 30 if there are less than 20 files in %DataLoc%. I modified code from a prior question. The problem

3条回答
  •  猫巷女王i
    2021-01-14 16:45

    Your script uses incorrect syntax for the loop variable in one of the two loops:

    FOR %F IN (c:\Play\hold\*.tmp) DO …
    

    Just try changing %F to %%F. Single percent sign plus letter is the syntax for loop variables when running loops directly from the command prompt. In batch scripts you should always use double-percent references for loop variables, just like in your FOR /F %%a loop.

提交回复
热议问题