-
Notifications
You must be signed in to change notification settings - Fork 0
/
cyberpunk_backuper.bat
64 lines (43 loc) · 1.07 KB
/
cyberpunk_backuper.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
:: Currently Cyberpunk 2077 save can't be more than 8 MB
:: This script backuping your saves
@ECHO OFF
CLS
COLOR 0f
Title Create Cyberpunk 2077 saves backup
@cd/d "%~dp0"
SETLOCAL
:: Get Current Time
SET YEAR=%date:~6,4%
SET MONTH=%date:~3,2%
SET DAY=%date:~0,2%
SET HOUR=%time:~0,2%
IF %HOUR% lss 10 (SET HOUR=0%time:~1,1%)
SET NN=%time:~3,2%
SET SS=%time:~6,2%
SET MS=%time:~9,2%
SET timestamp=%YEAR%-%MONTH%-%DAY%_%HOUR%-%NN%-%SS%-%MS%
:: Backup
SET SavesBackups=%CD%\SavesBackups\%timestamp%
SET SavesFolder=%USERPROFILE%\Saved Games\CD Projekt Red\Cyberpunk 2077
ECHO Saves:
DIR /P /S /B "%SavesFolder%"
ECHO.
ECHO Saves coping to %SavesBackups%
ECHO.
IF NOT EXIST "%SavesBackups%" MD "%SavesBackups%"
XCOPY /S /E "%SavesFolder%" "%SavesBackups%"
IF NOT EXIST "%SavesBackups%" ECHO "Backuping saves is failing"
ECHO.
ECHO Backup attempt completed
ECHO.
:: Is folder empty
SET _temp=
FOR /f "delims=" %%a in ('DIR /a /b "%SavesBackups%"') do SET _temp=%%a
IF {%_temp%} NEQ {} (
ECHO Backup created
ECHO.
ECHO Backuped saves:
DIR /P /S /B "%SavesBackups%"
ECHO.
)
PAUSE