@echo off
set OUTPUT=c:\webclient\logs\%date:~6,4%-%date:~3,2%-%date:~0,2%-runonce.log

if "%STDOUT_REDIRECTED%" == "" (
    set STDOUT_REDIRECTED=yes
    cmd.exe /c %0 %* >%OUTPUT%
    exit /b %ERRORLEVEL%
)

@echo on
sc config w32time start= auto
net stop w32time
net time /SETSNTP:www.forwardmobile.ru
reg add HKLM\SYSTEM\ControlControlSet\Services\W32Time\TimeProviders\NtpClient /v SpecialPollInterval /t REG_DWORD /d 43200 /f
reg add HKLM\SYSTEM\ControlSet001\Services\W32Time\TimeProviders\NtpClient /v SpecialPollInterval /t REG_DWORD /d 43200 /f
reg import wrq.reg
net start w32time
net time /set /y
shutdown /r /t 30 /f
del runonce.cmd
