I made a tool for window users to automatically backup there project directory in case of any accident resulting in data loss.
This only works on windows as it is a batch file command.
HOW IT WORKS AND HOW TO USE
PUT THE BATCH FILE ON YOUR DESKTOP!!! DO NOT PUT IT ANYWHERE ELSE I'M NOT RESPONSIBLE FOR ANY ACCIDENTAL DAMAGE! (really it shouldnt be a problem but batchfiles are very picky)
if you read that and accept that I'm not responsible for any misuse of the program then open the spoiler below
password is "ineedbackup"
The batch file asks for the location of the folder you save your projects into and copies them to your desktop
If you have 7zip you can use the option to zip the newly created backup for you.
The batch file will tell you the amount of time it takes to back up your files and how long it takes to zip the backup folder.
Version 1 error: The time calculation is a bodge because batch for whatever reason hates math with time and ever 2/10 runs of the batch file it will give some wrong calculation of time passed and with some ignore-able error about not having a real number to do math with
I guess you could just copy this to a text file and run it as a .bat
again I take no responsibility if you use this in any other way then how I say to use it
again I take no responsibility if you use this in any other way then how I say to use it
Code:
:BULL💩💩💩💩
color 0a
TITLE EvanSki's AutoBackup V.1.0
goto SETUP
:SETUP
@echo off
cls
echo INPUT DIRECTORY OF GAMEMAKER PROJECTS FOLDER IE:(C:\Users\YOURNAME\Documents\GameMakerStudio2\projects)
set /p projdir=
::SET THE START TIME OF THE BATCH FILE
set STARTTIME=%time%
set STARTHH=%STARTTIME:~0,2%
set STARTMI=%STARTTIME:~3,2%
set STARTSS=%STARTTIME:~6,2%
set STARTFF=%STARTTIME:~9,2%
goto BACKUP_START
:BACKUP_START
cls
echo BACKUP STARTING...
set Desktop=%CD%
set DDMMYYYY=%DATE:~7,2%_%DATE:~4,2%_%DATE:~10,4%
echo %DDMMYYYY%
md "%DDMMYYYY%"
cls
echo BACKUP FOLDER CREATED! STARTING BACKUP...
ping localhost -n 3 >nul
cd %projdir%
xcopy /s "%projdir%\*" "%DESKTOP%\%DDMMYYYY%" /i
ping localhost -n 3 >nul
goto CALCTIME
:CALCTIME
cls
:: SET STOP TIME FOR BATCH FILE
set STOPTIME=%time%
echo BACKUP COMPLETED!
echo _______________________
echo StartTime : %STARTTIME%
echo EndTime : %STOPTIME%
echo _______________________
::GET EXACT END TIME
set ENDHH=%STOPTIME:~0,2%
set ENDMI=%STOPTIME:~3,2%
set ENDSS=%STOPTIME:~6,2%
set ENDFF=%STOPTIME:~9,2%
set /a FINALHH= %ENDHH%-%STARTHH%
set /a FINALMI= %ENDMI%-%STARTMI%
set /a FINALSS= %ENDSS%-%STARTSS%
set /a FINALFF= %ENDFF%-%STARTFF%
echo COMPLETED IN:
echo %FINALHH% Hours
echo %FINALMI% Mins
echo %FINALSS% Secs
echo %FINALFF% MSecs
echo .
echo .
ping localhost -n 3 >nul
::ZIP
goto ZIPFILE
::goto wantsomezip
:wantsomezip
echo Would you like to Zip %DDMMYYYY% ? (y/n) (This requires having 7zip installed, (you probably already have it))
set /p fzip=
if %fzip% == y goto ZIPFILE
if %fzip% == n goto BATEND
goto wantsomezip
:BATEND
echo BATCH FILE WILL NOW CLOSE
ping localhost -n 3 >nul
exit
:ZIPFILE
::GET START TIME FOR ZIP
set ZIPSTARTTIME=%time%
set ZIPSTARTHH=%ZIPSTARTTIME:~0,2%
set ZIPSTARTMI=%ZIPSTARTTIME:~3,2%
set ZIPSTARTSS=%ZIPSTARTTIME:~6,2%
set ZIPSTARTFF=%ZIPSTARTTIME:~9,2%
cd C:\Program Files\7-Zip
7z.exe a "%desktop%\%DDMMYYYY%.7z" "%desktop%\%DDMMYYYY%\"
::GET END TIME FOR ZIP
set ZIPSTOPTIME=%time%
set ZIPENDHH=%ZIPSTOPTIME:~0,2%
set ZIPENDMI=%ZIPSTOPTIME:~3,2%
set ZIPENDSS=%ZIPSTOPTIME:~6,2%
set ZIPENDFF=%ZIPSTOPTIME:~9,2%
set /a ZIPFINALHH= %ZIPENDHH%-%ZIPSTARTHH%
set /a ZIPFINALMI= %ZIPENDMI%-%ZIPSTARTMI%
set /a ZIPFINALSS= %ZIPENDSS%-%ZIPSTARTSS%
set /a ZIPFINALFF= %ZIPENDFF%-%ZIPSTARTFF%
echo _____________________________________
echo ZIP COMPLETED IN:
echo %ZIPFINALHH% Hours
echo %ZIPFINALMI% Mins
echo %ZIPFINALSS% Secs
echo %ZIPFINALFF% MSecs
ping localhost -n 3 >nul
exit
:BULL
color 0a
TITLE EvanSki's AutoBackup V.1.1
goto SETUP
:SETUP
@Echo off
cls
echo INPUT DIRECTORY OF GAMEMAKER PROJECTS FOLDER IEC:\Users\YOURNAME\Documents\GameMakerStudio2\projects)
set /p projdir=
::SET THE START TIME OF THE BATCH FILE
set STARTTIME=%time%
goto BACKUP_START
:BACKUP_START
cls
echo BACKUP STARTING...
set Desktop=%CD%
set DDMMYYYY=%DATE:~7,2%_%DATE:~4,2%_%DATE:~10,4%
echo %DDMMYYYY%
md "%DDMMYYYY%"
cls
echo BACKUP FOLDER CREATED! STARTING BACKUP...
ping localhost -n 3 >nul
cd %projdir%
xcopy /s "%projdir%\*" "%DESKTOP%\%DDMMYYYY%" /i
ping localhost -n 3 >nul
goto CALCTIME
:CALCTIME
cls
:: SET STOP TIME FOR BATCH FILE
set STOPTIME=%time%
echo BACKUP COMPLETED!
echo _______________________
echo StartTime : %STARTTIME%
echo EndTime : %STOPTIME%
echo _______________________
echo .
echo .
ping localhost -n 3 >nul
::ZIP
goto ZIPFILE
::goto wantsomezip
:wantsomezip
echo Would you like to Zip %DDMMYYYY% ? (y/n) (This requires having 7zip installed, (you probably already have it))
set /p fzip=
if %fzip% == y goto ZIPFILE
if %fzip% == n goto BATEND
goto wantsomezip
:BATEND
echo BATCH FILE WILL NOW CLOSE
ping localhost -n 3 >nul
exit
:ZIPFILE
cd C:\Program Files\7-Zip
7z.exe a "%desktop%\%DDMMYYYY%.7z" "%desktop%\%DDMMYYYY%\"
echo _____________________________________
echo FILE ZIPPED!
ping localhost -n 3 >nul
exit
color 0a
TITLE EvanSki's AutoBackup V.1.1
goto SETUP
:SETUP
@Echo off
cls
echo INPUT DIRECTORY OF GAMEMAKER PROJECTS FOLDER IEC:\Users\YOURNAME\Documents\GameMakerStudio2\projects)
set /p projdir=
::SET THE START TIME OF THE BATCH FILE
set STARTTIME=%time%
goto BACKUP_START
:BACKUP_START
cls
echo BACKUP STARTING...
set Desktop=%CD%
set DDMMYYYY=%DATE:~7,2%_%DATE:~4,2%_%DATE:~10,4%
echo %DDMMYYYY%
md "%DDMMYYYY%"
cls
echo BACKUP FOLDER CREATED! STARTING BACKUP...
ping localhost -n 3 >nul
cd %projdir%
xcopy /s "%projdir%\*" "%DESKTOP%\%DDMMYYYY%" /i
ping localhost -n 3 >nul
goto CALCTIME
:CALCTIME
cls
:: SET STOP TIME FOR BATCH FILE
set STOPTIME=%time%
echo BACKUP COMPLETED!
echo _______________________
echo StartTime : %STARTTIME%
echo EndTime : %STOPTIME%
echo _______________________
echo .
echo .
ping localhost -n 3 >nul
::ZIP
goto ZIPFILE
::goto wantsomezip
:wantsomezip
echo Would you like to Zip %DDMMYYYY% ? (y/n) (This requires having 7zip installed, (you probably already have it))
set /p fzip=
if %fzip% == y goto ZIPFILE
if %fzip% == n goto BATEND
goto wantsomezip
:BATEND
echo BATCH FILE WILL NOW CLOSE
ping localhost -n 3 >nul
exit
:ZIPFILE
cd C:\Program Files\7-Zip
7z.exe a "%desktop%\%DDMMYYYY%.7z" "%desktop%\%DDMMYYYY%\"
echo _____________________________________
echo FILE ZIPPED!
ping localhost -n 3 >nul
exit
Last edited: