CheckAUService fixed wuauserv not running

CheckAUService fixed wuauserv not running

Postby 1inux » 10.11.2011, 14:21

Sometimes doupdate.cmd stop with the error that wuauserv is not running.

In DoUpdate.cmd a added the following lines:
Code: Select all
if /i "%AU_SVC_STATE_INITIAL%"=="" goto ListMissingIds
if /i "%AU_SVC_STATE_INITIAL%"=="Unknown" goto ListMissingIds
if /i "%AU_SVC_STATE_INITIAL%"=="Running" goto ListMissingIds
if /i "%AU_SVC_START_MODE%"=="Disabled" goto AUSvcNotRunning
echo Starting service 'automatic updates' (wuauserv)...
%SystemRoot%\system32\net.exe start wuauserv >nul

rem: ----8<----fixing problem because allready startet----8<---
if errorlevel 1 (
echo Restarting service 'automatic updates' (wuauserv)...
  %SystemRoot%\system32\net.exe stop wuauserv >nul
  %SystemRoot%\system32\net.exe start wuauserv >nul
  if errorlevel 1 (
    echo %DATE% %TIME% - Error: Restarting service 'automatic updates' (wuauserv) failed, reboot now >>%UPDATE_LOGFILE%
    %SystemRoot%\system32\shutdown -r -t 3
  )
)
rem: ----8<----fixing problem because allready startet----8<---

rem: if errorlevel 1 goto AUSvcNotRunning
set AU_SVC_STARTED=1
echo %DATE% %TIME% - Info: Started service 'automatic updates' (wuauserv) >>%UPDATE_LOGFILE%


Cheers
Jan
1inux
 

Re: CheckAUService fixed wuauserv not running

Postby WSUSUpdateAdmin » 23.11.2011, 11:53

Hi Jan,

thanks for your suggestion!
I prefer a slightly different solution in http://trac.wsusoffline.net/browser/trunk (r315): "- Fix: When running under WOUTempAdmin user account, DoUpdate.cmd script will now assume that the service 'automatic updates' (wuauserv) is running if its start mode is 'Auto' (Thanks to "1inux")".

Regards
Torsten
Last edited by aker on 28.07.2013, 17:57, edited 1 time in total.
Reason: updated Trac Link
WSUSUpdateAdmin
Administrator
 
Posts: 2245
Joined: 07.07.2009, 14:38


Return to Anregungen / Suggestions

Who is online

Users browsing this forum: Google [Bot] and 19 guests