
@ECHO OFF
REM backup.bat
REM Backup of scenario folder RW to backup folder Work
REM Change values for RW and Work for your project
SET RW=I:\Steam\steamapps\common\railworks\Content\Routes\00000032-0000-0000-0000-000000000000\Scenarios\57474de9-8eef-4fd8-9896-a76b1464693d
SET Work=D:\Users\Chacal\Documents\Trains\RW\MyScenario
rem Parse the date (e.g., 2013-01-01)
REM Note that the output of date and time is locale-dependent
REM This is for a YYYY-MM-DD HH:MM:SS:MM format
REM You must change this for your own locale format.
set cur_yyyy=%date:~0,4%
rem the above line means take 4 characters from position 0
set cur_mm=%date:~5,2%
set cur_dd=%date:~8,2%
rem Parse the time (e.g., 16:20:08,69)
set cur_hh=%time:~0,2%
if %cur_hh% lss 10 (set cur_hh=0%time:~1,1%)
set cur_nn=%time:~3,2%
set cur_ss=%time:~6,2%
set cur_ms=%time:~9,2%
rem Set the timestamp format
set timestamp=%cur_yyyy%-%cur_mm%-%cur_dd%_%cur_hh%h%cur_nn%
rem Make a new folder and copy the scenario files in it
ECHO %timestamp%
CD %Work%
MD %timestamp%
CD %timestamp%
XCOPY %RW% /S
rem All done, show results and wait for a keypress
PAUSE
rem Clear the environment variables
set cur_yyyy=
set cur_mm=
set cur_dd=
set cur_hh=
set cur_nn=
set cur_ss=
set cur_ms=
set timestamp=
Set RW=
Set Work=
Return to Problems and Peculiarities
Users browsing this forum: No registered users and 2 guests