Created
January 5, 2022 06:31
-
-
Save BrynM/1ace153263c0e9accf1f9404175a2448 to your computer and use it in GitHub Desktop.
NMS Save Backup Batch File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal ENABLEDELAYEDEXPANSION | |
REM User settgins | |
set nmsSaveDir=NMS | |
set outDir=%nmsSaveDir%_backups | |
REM Automated settings | |
set goodDate=!date:~10,4!!date:~4,2!!date:~7,2! | |
set timestamp=%goodDate%_%time::=.% | |
echo Timestamp: %timestamp% | |
set outFile=NMS_%timestamp%.zip | |
REM Do things ans stuff. | |
if not exist %outDir% ( echo Creating directory "%outDir%"... ) && ( mkdir %outDir% ) | |
echo Checking "%outDir%\%outFile%"... | |
if exist %outDir%\%outFile% goto failsafe | |
echo Zipping "%outDir%\%outFile%"... | |
REM Let's keep backups but remember how the option is used. | |
REM zip -r9 %outDir%\%outFile% %nmsSaveDir% -x %nmsSaveDir%?Backup* | |
( zip -r9 %outDir%\%outFile% %nmsSaveDir% ) && ( echo Writing "%outDir%\%outFile%" complete. ) | |
goto ending | |
REM GOTO! HAHA! | |
:failsafe | |
echo Error - File "%outDir%\%outFile%" exists^^! | |
echo Aborted^^! | |
pause | |
:ending |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This will create timestamped ZIP files backing up all NMS saves for the current user. You'll need some form pf
zip
someplace in your path. I use the 7Zip binaries.Plop this in
%APPDATA%\Roaming\HelloGames
and double-click it in there.