Created
July 1, 2022 04:34
-
-
Save maciakl/16b248c1b7ccf21f9dc04a1d9744e74b to your computer and use it in GitHub Desktop.
Revisions
-
maciakl created this gist
Jul 1, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ @echo off if "%1" == "elevated" goto start powershell -command "Start-Process %~nx0 elevated -Verb runas" goto :eof :start @echo off cls echo. echo. echo Shadowcopy Helper echo ================= echo. CALL :COMPUTERNAME CALL :CHECK echo. choice /M "Create or Quit" /C CQ if %ERRORLEVEL% == 1 ( CALL :CREATE ) if %ERRORLEVEL% == 2 ( goto :eof ) goto :start :CREATE call :GETPW schtasks /create /sc daily /tn "DG\shadowcopy" /st 13:00 /ru %COMPUTERNAME%\Administrator /rp %pw% /tr "wmic shadowcopy call create Volume=""c:\\""" echo. pause goto :eof :CHECK echo. schtasks | findstr shadowcopy echo. goto :eof :COMPUTERNAME for /f "skip=1" %%i in ('wmic computersystem get name') DO ( SET COMPUTERNAME=%%i goto :eof ) :GETPW set /P pw=Enter password, then press ENTER: goto :eof