Skip to content

Instantly share code, notes, and snippets.

@BrynM
Created January 5, 2022 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrynM/1ace153263c0e9accf1f9404175a2448 to your computer and use it in GitHub Desktop.
Save BrynM/1ace153263c0e9accf1f9404175a2448 to your computer and use it in GitHub Desktop.
NMS Save Backup Batch File
@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
@BrynM
Copy link
Author

BrynM commented Jan 5, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment