Windows 11 – Automatically Make Zip Archives of Every Folder with Random Names

7-ziparchivinggamingwindowswindows-11

I want to automatically save archives of Roblox versions. The Roblox versions folder path is "C:\Users\USERNAME\AppData\Local\Roblox\Versions". It normally only has 2 folders: one for Roblox, and another for Roblox Studio.
The folders are named "version-" and then a bunch of random letters and numbers.


Each time Roblox updates, it deletes the old folder and makes a new one named "version-" and then a bunch of random letters and numbers. The names are the same for every person with the same version, it's just randomized before it gets put into an update. The current Roblox version I have is a folder named "version-aa6e1ad459964fc3". And the current Roblox Studio version I have is a folder named "version-698262888e864914". I can just manually archive them, but I think I would forget sometimes and then nobody else would have an archive, and then the version would be lost forever/until someone who stopped playing Roblox with the version on their computer comes back and finds it on their computer and uploads it online.
So, is there a way to do this automatically? I've tried using 7-zip with batch files and Task Scheduler and I got stuck trying to figure out what command to use.


Also, the 2 archives I have saved are around 200mb each, and I have 774gb of free space left on Drive D: and if my calculations are correct, I can fit around 3870 Roblox version archives in there. And Roblox updates once every 3-4 days, so it would take around 11610 days for Drive D: to fill up with archives. I'm not worried about my storage space.

Best Answer

You have enough DiskSpace , thus zipping is not necessary & simple copying will do.

COPY : use to copy files
XCOPY : use to copy whole folders

Have a simple batch script which does this:
DIR C:\Users\USERNAME\AppData\Local\Roblox\Versions\
XCOPY /E /V /C /H /K /O /X /Y /J C:\Users\USERNAME\AppData\Local\Roblox\Versions\* D:\roblox-archives\
DIR D:\roblox-archives\

Meaning:

C:\Users\USERNAME\AppData\Local\Roblox\Versions\* IS SOURCE , using wildcard to match the ever changing folder name  
D:\roblox-archives\ IS DESTINATION (make sure it exists)  
DIR on the SOURCE to see what new content is available  
DIR on the DESTINATION to see what content has been archived till now  

XCOPY OPTIONS :  
  /E           Copies directories and subdirectories, including empty ones
  /V           Verifies the size of each new file  
  /C           Continues copying even if errors occur  
  /H           Copies hidden and system files also  
  /K           Copies attributes  
  /O           Copies file ownership and ACL information  
  /X           Copies file audit settings  
  /Y           Suppresses prompting  
  /J           Copies using unbuffered I/O. Recommended for very large files  

Initially, go to a CMD Prompt, and execute this bat script. Ensure that it works. When you are satisfied with the selected necessary flags, you can can re-run it , to ensure it works even when re-copying , that is , when SOURCE already exists on DESTINATION.

With all these checks going through , you can move on to automating it:
Put this script in task Scheduler to execute once a Day. Done.

Once in a while, you can have a look into D:\roblox-archives\ & maybe make a zip file every month or so, by selecting all and making new zip file.

Related Question