I am playing a alpha game which when crashes corrupts the saved game, so i created a batch file to back up my saved game.
@echo off
:A
REM deletes old backup
RMDIR /S /Q "backup location 1"
REM creates back up
xcopy "game location" "backup location 1" /e /i /q /r /y
REM adds time out for 300 seconds
timeout /t 300
REM deletes old backup
RMDIR /S /Q "backup location 2"
REM creates back up
xcopy "game location" "backup location 2" /e /i /q /r /y
REM adds time out for 300 seconds
timeout /t 300
REM Repeats
Goto A
This works just fine but it always stars on the first back up. What I want to do is have it continue from the previous point of backing up. I created the following test file
@echo off
set point=a
echo The variable is "%point%"
if %point%==c (goto :a)
if %point%==a (goto :b)
if %point%==b (goto :c)
:a
Echo A
set point=a
echo The variable is now "%point%"
pause
:b
Echo B
set point=b
echo The variable is now "%point%"
Pause
:c
Echo C
set point=c
echo The variable is now "%point%"
Pause
When the file is restarted the point variable is the same.
Is it possible to have the set point= save the variable to the file for the next time it is run?
Can you please explain any code suggested, I can use google to research it myself and probably will to get a better understanding. But if it is too complicated I may not know what I am looking at to google it.
Thank you for any help