mirror of
https://github.com/winapps-org/winapps.git
synced 2025-11-15 02:44:02 +01:00
Schedule timesync.ps1 in install.bat
Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>
This commit is contained in:
@@ -23,3 +23,20 @@ if %ERRORLEVEL% equ 0 (
|
|||||||
) else (
|
) else (
|
||||||
echo Failed to create scheduled task.
|
echo Failed to create scheduled task.
|
||||||
)
|
)
|
||||||
|
|
||||||
|
REM Create time sync task to be run by the user at login
|
||||||
|
copy %~dp0\TimeSync.ps1 %windir%
|
||||||
|
set "taskname2=TimeSync"
|
||||||
|
set "command2=powershell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -File \"%windir%\TimeSync.ps1\""
|
||||||
|
|
||||||
|
schtasks /query /tn "%taskname2%" >nul
|
||||||
|
if %ERRORLEVEL% equ 0 (
|
||||||
|
echo %DATE% %TIME% Task "%taskname2%" already exists, skipping creation.
|
||||||
|
) else (
|
||||||
|
schtasks /create /tn "%taskname2%" /tr "%command2%" /sc onlogon /rl HIGHEST /f
|
||||||
|
if %ERRORLEVEL% equ 0 (
|
||||||
|
echo %DATE% %TIME% Scheduled task "%taskname2%" created successfully.
|
||||||
|
) else (
|
||||||
|
echo %DATE% %TIME% Failed to create scheduled task %taskname2%.
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user