w10install/optional/install-snapcontrol.cmd

50 lines
1.2 KiB
Batchfile
Raw Normal View History

2022-11-13 22:12:39 +01:00
@echo off
call check-for-admin
if %ERRORLEVEL% neq 0 exit /b
2022-11-13 22:12:39 +01:00
2023-03-11 23:38:45 +01:00
set TOOLS=%SystemDrive%\tools
2024-02-24 16:53:31 +01:00
set INIFILE=config\snapcontrol.ini
2024-02-22 16:05:29 +01:00
set SOFTWARE=..\software
2024-02-24 16:53:31 +01:00
set STARTMENU="%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\tools"
if NOT EXIST %SOFTWARE%\snapcontrol.exe (
echo ERROR: %SOFTWARE%\snapcontrol.exe not found!
exit /b
)
2022-11-13 22:12:39 +01:00
echo ####### %0 #######
2024-02-24 16:53:31 +01:00
echo killing snapcontrol processes...
taskkill /F /IM snapcontrol.exe 2>nul
echo killing snapshot processes...
taskkill /F /IM snapshot64.exe 2>nul
2024-02-22 16:05:29 +01:00
echo copy snapcontrol binary to [ %windir% ] ...
copy /Y %SOFTWARE%\snapcontrol.exe %windir% 2>nul
2023-03-12 11:28:34 +01:00
2024-02-22 16:05:29 +01:00
if EXIST %SOFTWARE%\snapshot64_licensed.exe (
echo copying LICENSED snapshot64 to %windir% ...
copy /Y %SOFTWARE%\snapshot64_licensed.exe %windir%\snapshot64.exe
) else (
echo copying STANDARD snapshot64 to boot image ...
2024-02-24 16:53:31 +01:00
copy /Y %SOFTWARE%\snapshot64.exe %windir%
2024-02-22 16:05:29 +01:00
)
2024-02-21 13:25:46 +01:00
2024-02-22 16:05:29 +01:00
if NOT EXIST %windir%\snapcontrol.ini (
echo copying STANDARD inifile to %windir% ...
copy /Y %INIFILE% %windir%
) else (
echo inifile already copied. nothing to do!
2024-02-22 14:24:16 +01:00
)
2024-02-22 16:05:29 +01:00
echo creating scheduler task ...
%windir%\snapcontrol /I
2024-02-24 16:53:31 +01:00
echo copy startmenu link ...
copy /Y "startmenu\Drive Snapshot.lnk" %STARTMENU%
2022-11-13 22:12:39 +01:00
echo ####### %0 #######
pause