Masland Posted December 26, 2005 Posted December 26, 2005 Is it possible to run windows update unattended using guirunonce or some other method?
druiddk Posted December 26, 2005 Posted December 26, 2005 Why not just slipstream the hotfixes before installing Windows?
DonDamm Posted December 27, 2005 Posted December 27, 2005 Maybe he's thinking about sending it to someone who might not install it for a month or two. I did that, so I understand. Of course you slipstream to make t as up-to-date as possible, but one of the things you do it for is to save time in the future. If you are constantly preparing new versions, then you're not saving much time at all.I like to keep up-to-date and fiddle, but I know many don't. They want to set it up and then only use it when they need it. If it auto updates, all the better.Now, I thought of a way you might do that, but it is not completely clear in my mind yet. First you have to be connected. Second you'll need to set the Automatic updates in the security center set to On. Then, you should be able to invoke the service through RunOnceEx on first or even second reboot.Now, offhand I can't think of how to set the AutoUpdates to On, but I'm sure there is a way. If I find it, I'll try to get back to this thread! )Cheers,
BoardBabe Posted December 27, 2005 Posted December 27, 2005 Enable AutoUpdate (download & install critical updates)[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update]"AUOptions"=dword:00000004
DonDamm Posted February 20, 2006 Posted February 20, 2006 God I love this place! Thanks for the post, BoardBabe. :^)
russ9898 Posted February 21, 2006 Posted February 21, 2006 do i just save that code as a .reg file and set it to run in my runonceex.cmd file?
BoardBabe Posted February 26, 2006 Posted February 26, 2006 russ9898:That is one way to do it yea:Only you need to include one line at the top, copy paste the following to notepad and save as .reg. launch silently with regedit /s filename.reg.Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update]"AUOptions"=dword:00000004
Bezalel Posted February 26, 2006 Posted February 26, 2006 If you set AUOptions to 4 you must also set ScheduledInstallDay and ScheduledInstallTimeWindows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update]"AUOptions"=dword:00000004"ScheduledInstallDay"=dword:00000000"ScheduledInstallTime"=dword:00000003
`Felix` Posted February 26, 2006 Posted February 26, 2006 (edited) Here is a cmd file that will do it all for you in one go... has been tried and tested @echo off:: Here is a quick way to split the date into parts.:: Supports yyyy-dd-mm, yyyy-mm-dd, mm-dd-yyyy, and dd-mm-yyyy,:: doesn't rely on dashes vs slashes.for /f "tokens=2,*" %%d in ("%date%") do set today=%%decho. | date | find "(yy" > nulif !%errorlevel%!==!0! (set year=%today:~0,4%echo. | date | find "mm)" > nulif !%errorlevel%!==!0! (set month=%today:~-2%set day=%today:~-5,2%) else (set month=%today:~-5,2%set day=%today:~-2%)) else (set year=%today:~-4%echo. | date | find "(mm" > nulif !%errorlevel%!==!0! (set month=%today:~0,2%set day=%today:~3,2%) else (set month=%today:~3,2%set day=%today:~0,2%)):: Write the registy file for import with the correct date and timeecho Windows Registry Editor Version 5.00 > %tmp%\wuset.regecho [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update] >> %tmp%\wuset.reg:: Change this option below to what you want your configuration to be...:: dword:00000004 = Automatic (recommended):: dword:00000003 = Download updates for me, but let me choose when to install them.:: dword:00000002 = Notify me but don't automatically download or install them:: dword:00000004 = Turn off Automatic Updates (not recommended!)echo "AUOptions"=dword:00000004 >> %tmp%\wuset.regecho "ConfigVer"=dword:00000001 >> %tmp%\wuset.reg:: You can change the default time for checking from 3am (below and default) to what you like...echo "NextDetectionTime"="%year%-%month%-%day% 03:00:00" >> %tmp%\wuset.regecho "ScheduledInstallDate"="%year%-%month%-%day% 03:00:00" >> %tmp%\wuset.regecho "ScheduledInstallDay"=dword:00000000 >> %tmp%\wuset.regecho "ScheduledInstallTime"=dword:00000003 >> %tmp%\wuset.regecho "SetupWizardLaunchTime"=- >> %tmp%\wuset.reg:: Now apply the correct settings to the registryregedit /s "%tmp%\wuset.reg":: Clean-up - Delete the reg file after usedel /f /q "%tmp%\wuset.reg"Enjoy Edited February 26, 2006 by `Felix`
Aid Posted February 26, 2006 Posted February 26, 2006 Great script Felix, will come into some good use.
Bezalel Posted February 26, 2006 Posted February 26, 2006 Felix, I have a few issues with your script. After each detection AU sets the next detection to a random time between 16.5 and 22 hours forward so the NextDetectionTime value is unneeded. The ScheduledInstallDate value is set after an update has been downloaded and has no effect of there are no updates waiting to be installed. Deleting the SetupWizardLaunchTime value is not needed because the AU client deletes this key if AUOptions is anything other than 0.If you want a script here's a much cleaner script:NET STOP "Automatic Updates"REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions REG_DWORD /d 00000004REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v ScheduledInstallDay REG_DWORD /d 00000000REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v ScheduledInstallTime REG_DWORD /d 00000003NET START "Automatic Updates"WUAUCLT /DETECTNOWMy script also restarts the service so the changes take effect and forces a detection and doesn't need any temporary files.
`Felix` Posted February 27, 2006 Posted February 27, 2006 Felix, I have a few issues with your script. After each detection AU sets the next detection to a random time between 16.5 and 22 hours forward so the NextDetectionTime value is unneeded. The ScheduledInstallDate value is set after an update has been downloaded and has no effect of there are no updates waiting to be installed. Deleting the SetupWizardLaunchTime value is not needed because the AU client deletes this key if AUOptions is anything other than 0.If you want a script here's a much cleaner script:NET STOP "Automatic Updates"REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions REG_DWORD /d 00000004REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v ScheduledInstallDay REG_DWORD /d 00000000REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v ScheduledInstallTime REG_DWORD /d 00000003NET START "Automatic Updates"WUAUCLT /DETECTNOWMy script also restarts the service so the changes take effect and forces a detection and doesn't need any temporary files.Good stuff and thanks for the clarification. I was just doing some checking of the registry as i made changes manually and put the script together based on that... Always happy to be wrong, as long as i learn from the mistakes I will give your script a test this evening.
Bezalel Posted February 27, 2006 Posted February 27, 2006 For those that want to tweak AU, here are a few more registry values (all are type dword defaults are in red)AutoInstallMinorUpdates (0,1) specifies that AU should immediatly install updates that never require a reboot without promping the user or waiting for the scheduled install timeDetectionFrequency (1-22) specifies how often in hours AU checks for updates (actual time will be a random interval between 75% and 100% of the value)DetectionFrequencyEnabled (0,1) must be set to 1 to use the previous settingRebootWarningTimeout (1-30,5) specifies in minutes how long the countdown window is shown before an automatic rebootRebootWarningTimeoutEnabled (0,1) must be set to 1 to use the previous settingNoAutoRebootWithLoggedOnUsers (0,1)RebootRelaunchTimeout (1-1440,10) specifies how often in minutes a user will be prompted to restart the computerRebootRelaunchTimeoutEnabled (0,1) must be set to 1 to use the previous settingRescheduleWaitTime (1-60) specifies how long in minutes to wait before installing if the computer was turned off at the scheduled install time (if this is not set missed updates will be installed at the next scheduled install time)RescheduleWaitTimeEnabled (0,1) must be set to 1 to use the previous setting
BoardBabe Posted February 28, 2006 Posted February 28, 2006 I don't see why you need to set ScheduledInstallDay and ScheduledInstallTime as the default value is already 0 and 3.
Bezalel Posted February 28, 2006 Posted February 28, 2006 I don't see why you need to set ScheduledInstallDay and ScheduledInstallTime as the default value is already 0 and 3.These default values are created by the control panel applet, these are not the default values that will be used if the values are absent. These values do not exist on a fresh install of Windows.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now