I download a lot of pictures for jigsaw puzzles. Then put a random number prefix on the file names so I can mix up groups of the same kind of picture.
For some reason I can't get files with spaces, commas and, such to copy. I've tried:
double quoting just the "%variable"
double quoting "drive\directory\%variable"
Also with single quotes and back quotes ( ` ).
If I try and move a file "test file.jp6" I get the following
TCC: (Sys) D:\tmp_y\Move_test.btm [15] The system cannot find the file specified.
"D:\tmp_y\Test"
TCC: (Sys) D:\tmp_y\Move_test.btm [15] The system cannot find the file specified.
"D:\tmp_y\File.jg6"
Here's the code:
Edited code to reflect what I have done since I update to ver. 21. 2017-11-14 19:22
For some reason I can't get files with spaces, commas and, such to copy. I've tried:
double quoting just the "%variable"
double quoting "drive\directory\%variable"
Also with single quotes and back quotes ( ` ).
If I try and move a file "test file.jp6" I get the following
TCC: (Sys) D:\tmp_y\Move_test.btm [15] The system cannot find the file specified.
"D:\tmp_y\Test"
TCC: (Sys) D:\tmp_y\Move_test.btm [15] The system cannot find the file specified.
"D:\tmp_y\File.jg6"
Here's the code:
Code:
@echo off
setlocal
:Main
on Break goto Done
dir /b D:\tmp_y\*.jg* > FileList.x
setdos /x-45678
set FileHandle=%@fileopen["FileList.x",r,t]
set FileName=%@fileread[%FileHandle]
set DirNum=0
set x=0
Do while %FileName ne **EOF**
If %@len[%DirNum] lt 2 set DirNum=0%DirNum
If not exist "d:\Games\BigJig\My_Jigsaws_%DirNum" md "d:\Games\BigJig\My_Jigsaws_%DirNum"
set x=%@inc[%x]
move /q "d:\tmp_y\%FileName" "d:\Games\BigJig\My_Jigsaws_%DirNum\"
set FileName=%@fileread[%FileHandle]
If %x eq 100 echo Moved to My_Jigsaws_%DirNum
If %x eq 100 set DirNum=%@inc[%DirNum]
If %x eq 100 set x=0
enddo
:Done
set FileHandle=%@fileclose[%FileHandle]
del /q FileList.x
endlocal
pause
quit
Edited code to reflect what I have done since I update to ver. 21. 2017-11-14 19:22
Last edited: