A potential long-shot, or maybe too much to do in a batch file (of which my knowledge is limited) but I'm looking at automating compression, renaming, deleting, and moving, multiple folders at the end of the day into their corresponding directories.
Folders to be renamed will all be in one folder, labeled in the same manner, examples below;
2305sdrfti2200dfsgh6hg
They'll be compressed and renamed to include the date they're being compressed on, with the original folders being deleted with -sdel, as below;
That's all under control with the batch file I've written, but the final hurdle is proving too tricky for me. I'd like for those files to then be moved into existing folders that are sorted via the first four digits of the zip file. So 2305 goes into 23\05\2305sdrfti - 2023-06-29.zip and 2200 goes into 22\00\2200dfsgh6hg - 2023-06-29.zip
Does anyone know if this is feasable? It'd be wonderful if someone could pass on some knowledge to help solve this! Lots of thanks in advance.
Here's what I've got so far that handles the above, minus the moving...
@echoofffor/f"delims="%%ain('wmic OS Get localdatetime ^| find "."')dosetdt=%%asetYYYY=%dt:~0,4%setMM=%dt:~4,2%setDD=%dt:~6,2%setstamp=%YYYY%-%MM%-%DD%for/d%%Xin(*)do"C:\Program Files\7-Zip\7z.exe"a"%%X - %stamp%.zip""%%X\"-sdel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A potential long-shot, or maybe too much to do in a batch file (of which my knowledge is limited) but I'm looking at automating compression, renaming, deleting, and moving, multiple folders at the end of the day into their corresponding directories.
Folders to be renamed will all be in one folder, labeled in the same manner, examples below;
They'll be compressed and renamed to include the date they're being compressed on, with the original folders being deleted with -sdel, as below;
That's all under control with the batch file I've written, but the final hurdle is proving too tricky for me. I'd like for those files to then be moved into existing folders that are sorted via the first four digits of the zip file. So 2305 goes into 23\05\2305sdrfti - 2023-06-29.zip and 2200 goes into 22\00\2200dfsgh6hg - 2023-06-29.zip
Does anyone know if this is feasable? It'd be wonderful if someone could pass on some knowledge to help solve this! Lots of thanks in advance.
Here's what I've got so far that handles the above, minus the moving...