CODE: [Copy to clipboard]
@echo off
if "%USERNAME%"=="" goto 2
set/p unbak= 卸载输入[ u ],其它键安装:
if /i "%unbak%"=="u" schtasks /delete /tn "gamebak" /f &pause&exit
net start | find /i "Scheduler" >nul 2>nul
If %Errorlevel% GTR 0 sc config schedule start= auto >nul 2>nul&&net start schedule >nul 2>nul
schtasks /delete /tn "gamebak" /f >nul 2>nul
schtasks /create /sc HOURLY /mo 1 /st 00:00:00 /tn "gamebak" /ru system /tr "%~f0" >nul 2>nul
:2
for /f "tokens=1,2 delims=:" %%a in ('reg query HKCR\WinRAR\DefaultIcon /ve^|find "WinRAR.exe"') do (
set patha=%%a
set pathb=%%b
)
if not exist "%patha:~-1,1%:%pathb:~0,-13%\Rar.exe" echo 请安装WinRar & ping -n 5 127.1>nul&exit
set tobak=D:\myspl\account D:\myspl\my
set bakpath=E:\bak
if not exist %bakpath% echo 错误!不存在路径:[ %bakpath% ]&ping -n 3 127.1>nul&exit
set/a hourn=%time:~0,2%*1
"%patha:~-1,1%:%pathb:~0,-13%\Rar.exe" a -m5 -sfx "%bakpath%\%date:~5,5%-%hourn%" %tobak%
if %hourn% GEQ 12 (set/a hourn=%hourn%-12) else (set/a hourn=%hourn%+12)
if exist "%bakpath%\%date:~5,5%-%hourn%.exe" del/f/q "%bakpath%\%date:~5,5%-%hourn%.exe"
exit
[