Skip to content

Commit ec03877

Browse files
committed
Don't start TimeSync.ps1 at every login, just after first one
Relating to #10
1 parent b24ac96 commit ec03877

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

config/oem/install.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ if %ERRORLEVEL% equ 0 (
5050
echo %DATE% %TIME% Task "%taskname2%" already exists, skipping creation. >> C:\OEM\setup.log
5151
) else (
5252
schtasks /create /tn "%taskname2%" /tr "%command2%" /sc onlogon /rl HIGHEST /f >> C:\OEM\setup.log 2>&1
53+
REM Ensure the TimeSync task only runs once per boot and does not restart on every logon (RDP, etc.)
54+
powershell -Command "Get-ScheduledTask -TaskName 'TimeSync' | Set-ScheduledTask -Settings (New-ScheduledTaskSettingsSet -MultipleInstances IgnoreNew)" >> C:\OEM\setup.log 2>&1
5355
if %ERRORLEVEL% equ 0 (
5456
echo %DATE% %TIME% Scheduled task "%taskname2%" created successfully. >> C:\OEM\setup.log
5557
) else (

0 commit comments

Comments
 (0)