HUGE problems where I work with Windows Update (among other things). Following in my mentor's path (the supply guy), I have written a batch script (not advanced enough to do VB yet), that takes care of several machine problems including windows update. Similar to the services check script. Note that this tool requires the 2003 SP1 tool kit.
@Echo Off
ECHO Begining Sanity Check...Standby
ECHO Runnig Command to Set Primary DNS
netsh interface ip set dns name="Local Area Connection" static 1.1.1.1 primary
ECHO Command Completed
ECHO Running Command to Set Primary WINS
netsh interface ip set WINS name="Local Area Connection" static 1.1.1.1 primary
Echo Command Completed
ECHO Running Command to Configure Registry Permissions
regini -w \\servername\tools\winreg.ini
ECHO Command Completed, Check Output for Errors
ECHO Beginig Windows Update Script
SET %WINDIR% C:\WINDOWS
SET %WIN2k% C:\WINNT
ECHO Setting Automatic Update Service Permissions
SC sdset wuauserv D
A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRS DRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPD TLOCRRC;;;PU)
ECHO Command completed
ECHO Running Automatic Updates Fix XP and 2003
net stop "automatic updates"
cd %WINDIR%
rename SoftwareDistribution %RANDOM%
net start "automatic updates"
ECHO Command completed
ECHO Running Automatic Updates Fix 2000
net stop "automatic updates"
cd %WIN2k%
rename SoftwareDistribution %RANDOM%
net start "automatic updates"
ECHO Command completed
ECHO Copying BITSADMIN
copy \\servername\tools\bitsadmin.exe
Echo Command Complete
ECHO Running BITS Repair
"\\servername\c$\tools\bitsadmin.exe" /util /repairservice /force
ECHO Command Completed, Please Check Output for Errors
ECHO Setting BITS Permissions
sc config BITS obj= LocalSystem
ECHO Command Completed
ECHO Registering DLL
regsvr32 msxml3.dll
ECHO Command Completed
ECHO Running GPUPDATE for WinXP and 2003
gpupdate /force
ECHO Command Completed
ECHO Running GPUPDATE for 2000
secedit /refreshpolicy machine_policy /enforce
ECHO Command Complete
ECHO Running Wuauclt Detect
wuauclt /detectnow
ECHO Command completed
ECHO Restarting Print Spooler
net stop "Print Spooler"
net start "Print Spooler"
ECHO Changing Local Administrator Password
copy \\servername\tools\pspasswd.exe
pspasswd Administrator newpassword
Echo Command Completed
ECHO Starting Required Services
net start "workstation"
net start "net logon"
net start "server"
net start "remote registry"
net start "AVG7 Alert Manager Server"
net start "AVG7 Update Service"
ECHO Command Completed
ECHO Disabling Computer Browser
net start "Browser"
ECHO Incase it was stopped
sc config "Browser" start= disabled
net stop "Browser"
ECHO Command Completed
ECHO Adding Domain Admins to Local Administrators Group
net localgroup administrators "domain\domain admins" /add
net localgroup administrators "domain\IT Admin" /add
ECHO Command Completed
ECHO Adding Domain Admins to Remote Desktop Users
net localgroup "Remote Desktop Users" "domain\domain admins" /add
net localgroup "Remote Desktop Users" "domain\IT Admin" /add
ECHO Command Completed
ECHO Clearing Memory
\\servername\c$\tools\clearmem
ECHO Command Complete
ECHO SANITY CHECK COMPLETE
pause
exit
Hyena Tool:
cmd /c \\server\tools\psexec.exe \\%E% -u domain\User -p Password -c -f -i "\\server\scripts\sanity_check.bat"
[This message has been edited by PT101 (edited 12-03-2006).]
@Echo Off
ECHO Begining Sanity Check...Standby
ECHO Runnig Command to Set Primary DNS
netsh interface ip set dns name="Local Area Connection" static 1.1.1.1 primary
ECHO Command Completed
ECHO Running Command to Set Primary WINS
netsh interface ip set WINS name="Local Area Connection" static 1.1.1.1 primary
Echo Command Completed
ECHO Running Command to Configure Registry Permissions
regini -w \\servername\tools\winreg.ini
ECHO Command Completed, Check Output for Errors
ECHO Beginig Windows Update Script
SET %WINDIR% C:\WINDOWS
SET %WIN2k% C:\WINNT
ECHO Setting Automatic Update Service Permissions
SC sdset wuauserv D

ECHO Command completed
ECHO Running Automatic Updates Fix XP and 2003
net stop "automatic updates"
cd %WINDIR%
rename SoftwareDistribution %RANDOM%
net start "automatic updates"
ECHO Command completed
ECHO Running Automatic Updates Fix 2000
net stop "automatic updates"
cd %WIN2k%
rename SoftwareDistribution %RANDOM%
net start "automatic updates"
ECHO Command completed
ECHO Copying BITSADMIN
copy \\servername\tools\bitsadmin.exe
Echo Command Complete
ECHO Running BITS Repair
"\\servername\c$\tools\bitsadmin.exe" /util /repairservice /force
ECHO Command Completed, Please Check Output for Errors
ECHO Setting BITS Permissions
sc config BITS obj= LocalSystem
ECHO Command Completed
ECHO Registering DLL
regsvr32 msxml3.dll
ECHO Command Completed
ECHO Running GPUPDATE for WinXP and 2003
gpupdate /force
ECHO Command Completed
ECHO Running GPUPDATE for 2000
secedit /refreshpolicy machine_policy /enforce
ECHO Command Complete
ECHO Running Wuauclt Detect
wuauclt /detectnow
ECHO Command completed
ECHO Restarting Print Spooler
net stop "Print Spooler"
net start "Print Spooler"
ECHO Changing Local Administrator Password
copy \\servername\tools\pspasswd.exe
pspasswd Administrator newpassword
Echo Command Completed
ECHO Starting Required Services
net start "workstation"
net start "net logon"
net start "server"
net start "remote registry"
net start "AVG7 Alert Manager Server"
net start "AVG7 Update Service"
ECHO Command Completed
ECHO Disabling Computer Browser
net start "Browser"
ECHO Incase it was stopped
sc config "Browser" start= disabled
net stop "Browser"
ECHO Command Completed
ECHO Adding Domain Admins to Local Administrators Group
net localgroup administrators "domain\domain admins" /add
net localgroup administrators "domain\IT Admin" /add
ECHO Command Completed
ECHO Adding Domain Admins to Remote Desktop Users
net localgroup "Remote Desktop Users" "domain\domain admins" /add
net localgroup "Remote Desktop Users" "domain\IT Admin" /add
ECHO Command Completed
ECHO Clearing Memory
\\servername\c$\tools\clearmem
ECHO Command Complete
ECHO SANITY CHECK COMPLETE
pause
exit
Hyena Tool:
cmd /c \\server\tools\psexec.exe \\%E% -u domain\User -p Password -c -f -i "\\server\scripts\sanity_check.bat"
[This message has been edited by PT101 (edited 12-03-2006).]