Other Options

/autoaccepteula

For some updates, an EULA (End-User License Agreement) has to be accepted by the user. With the option /autoaccepteula, all EULAs are accepted automatically before installing.

So the update installation works without any user interaction, the process can be completely unattended.

This works only if WuInstall is called by an administrator or a power user account.

/logfile file-to-log

This option logs the console output of WuInstall to the specified log file (each output line also contains the current timestamp).

For example, to log all already installed downloads:

 WUInstall.exe /search /criteria "IsInstalled=1" /logfile "c:\data\WuInstallLog.txt"

WuInstallLog.txt contains for example the following lines:

2010/08/24-08:10:37   Searching for updates ... Criteria: IsInstalled=1
2010/08/24-08:10:40  
2010/08/24-08:10:40 Result Code: Succeeded
2010/08/24-08:10:40   50 Updates found in total, filtering ...
2010/08/24-08:10:40   1. German Language Pack - Windows 7 (KB972813)   Severity: Unknown
2010/08/24-08:10:40   UpdateClassification - Updates  Product - Windows 7 Language Packs
2010/08/24-08:10:40   2. Windows Server Update Services 3.0 SP2 (KB972455)   Severity: Unknown
2010/08/24-08:10:40   UpdateClassification - Service Packs  Product - Windows 7
2010/08/24-08:10:40   3. French Language Pack - Windows 7 (KB972813)   Severity: Unknown
2010/08/24-08:10:40   UpdateClassification - Updates  Product - Windows 7 Language Packs

This option is obviously very useful when testing and debugging WuInstall scripts or when running WuInstall with a scheduled job or on remote machines.

Logfile variables

  • $RCC$ - Use this variable in the logfile name to include the current rebootcycle count in the filename. This variable is only suggested in combination with the /rebootcycle option
  • $DATETIME$ - Use this variable in the logfile name to include the current date and time in the filename.


Examples:

 WUInstall.exe /search /logfile "c:\data\$DATETIME$_WuInstallLog.txt" 

Resulting logfile name is: 2018-05-28_09_43_45_WuInstallLog.txt

 WUInstall.exe /install /rebootcycle 3 /logfile "c:\data\$RCC$_WuInstallLog.txt"

Resulting logfile name is: 3_WuInstallLog.txt → 2_WuInstallLog.txt → 1_WuInstallLog.txt


This variables can also be used with all other log and xml options.

/logfile_append file-to-log

The option /logfile_append is similar to /logfile, with the difference that the entries are appended at the end of the specified file, instead of creating a new file.

There are also additional filename variables.

/log_as_ansi

This option creates a ANSI-logfile. It must be combined with /logfile or /log_append.

There are also additional filename variables.

/maxruntime minutes

This option starts a timer with the specified number of minutes at the start of WuInstall and exits WuInstall (if it is not finished before the timer expires) with exit code 12. It exits at any case, no matter how far the execution of WuInstall is.

For example, with /maxruntime 5, WuInstall exits after 5 minutes displaying

Maxruntime timeout elapsed: 5, exiting process!

This option is intended for machines, where downloads take a lot of time, or machines, which hang for some reason, to prevent WuInstall from running endlessly.

Use this option with caution, especially when using the /use_wsus or /bypass_wsus options!

/simple_error

With this option, WuInstall returns 0 for any success and 1 for any error, regardless of the reason.

Which means, if the return code would be 0, 2, 3, 5 or 10, WuInstall returns 0 and displays the message

 Simple result specified, returning 0 for success!

In any other case (the remaining codes 1, 4, 6, 11, 12), WuInstall returns 1 and displays the message

 Simple result specified, returning 1 for error!

/show_progress

This option shows the progress for the download of every single update and the installation of the updates, using asynchronous downloads / installation.

On some machines under certain circumstances, the /show_progress option might cause problems, so use it only when manually testing scripts or searching for problems on a single workstation. It is not advised to use it in automated scripts on different workstations.

This feature is not recommended for the productive use of WuInstall!

/offline

This options STOPS WuInstall from connecting to the WSUS Server, or Microsoft Update site when searching updates. Instead it searches offline.

This option is quite useful for searching already installed updates. The criteria "IsInstalled=1" and the /uninstall option automatically trigger an offline search.

For example, check if the Update KB982214 is installed on a machine:

WUInstall.exe /search /criteria "IsInstalled=1" /offline /match "KB982214"

 /offline specified, searching offline...

Searching for updates ... Criteria: IsInstalled=1
Result Code: Succeeded

96 Updates found in total, filtering ...
Listing those matching search expression:  'KB982214'

1. Security Update for Windows 7 (KB982214)
 Severity: Important
 UpdateClassification - Security Updates
 Product - Windows 7

When not using IsInstalled=1, the search result list usually contains the updates found at the last online search.

/quiet

The update-installer is forced to do an installation without user interaction.

/disableprompt

Disables showing source prompts to a user when installing the updates.

/silent

Suppresses any console output (log file option is still working).

/donothing [retcode]

WuInstall takes no action and returns the specified retcode, 0 by default.

/xmlout file

Writes an XML report to the specified file. This file contains additional information about the machine.

There are also additional filename variables.


 <?xml version="1.0" encoding="UTF-8"?>
<wuinstall runtime_seconds="10" runtime="0d 00:00:10">
        <system-info>
                <wuinstall-version>WuInstall Version 2.0 Pro (codename AE), Build 2014-02-03</wuinstall-version>
                <windows>
                        <version>Microsoft Windows [Version 6.2.9200]</version>
                        <service-pack>No Service Pack installed!</service-pack>
                        <windows-update-agent>
                                <major-version>8</major-version>
                                <minor-version>0</minor-version>
                                <product-version>7.9.9600.16384</product-version>
                        </windows-update-agent>
                        <domain>WORKGROUP</domain>
                        <username>Michael</username>
                        <computername>MICHAEL-PC</computername>
                </windows>
                <processor-architecture>x86</processor-architecture>
                <WOW64>true</WOW64>
        </system-info>
        <wsus></wsus>
        <parameters>/search /xmlout c:\tmp\wuinstall.xml</parameters>
        <updates count="1">
        <update>
                <title>Definition Update for Windows Defender - KB2267602 (Definition 1.173.1428.0)</title>
                <description>Install
 this update to revise the definition files that are used to detect 
viruses, spyware, and other potentially unwanted software. Once you have
 installed this item, it cannot be removed.</description>
                <download_priority>Normal</download_priority>
                <eula_accepted>true</eula_accepted>
                <identity>4f25e1f8-186e-4d0b-b18c-6dab7c081c09</identity>
                <is_beta>false</is_beta>
                <is_downloaded>false</is_downloaded>
                <is_hidden>false</is_hidden>
                <is_installed>false</is_installed>
                <is_mandatory>false</is_mandatory>
                <is_present>true</is_present>
                <is_uninstallable>false</is_uninstallable>
                <kb_article_ids>
                        <kb_article_id>2267602</kb_article_id>
                </kb_article_ids>
                <last_deployment_change_time>2014-05-06</last_deployment_change_time>
                <max_download_size>127745424</max_download_size>
                <min_download_size>0</min_download_size>
                <msrc_severity></msrc_severity>
                <recommended_cpu_speed>0</recommended_cpu_speed>
                <recommended_hard_disk_space>0</recommended_hard_disk_space>
                <recommended_memory>0</recommended_memory>
                <support_url>http://go.microsoft.com/fwlink/?LinkId=52661</support_url>
                <update_type>Software</update_type>
                <categories>
                <category>
                <id>e0789628-ce08-4437-be74-2495b842f43b</id>
                <description>A
 broadly-released and frequent software update containing additions to a
 product's definition database. Definition databases are often used to 
detect objects with specific attributes, such as malicious code, 
phishing Web sites, or junk e-mail.</description>
                <name>Definition Updates</name>
                <order>-1</order>
                <type>UpdateClassification</type>
                </category>
                <category>
                <id>8c3fcc84-7410-4a95-8b89-a166a0190486</id>
                <description>Windows
 Defender helps protect your computer against pop-ups, slow performance,
 and security threats caused by spyware and other unwanted 
software.</description>
                <name>Windows Defender</name>
                <order>-1</order>
                <type>Product</type>
                </category>
                </categories>
                <download_result_code>NotStarted</download_result_code>
                <download_hresult></download_hresult>
                <download_hresult_text></download_hresult_text>
                <installation_result_code>NotStarted</installation_result_code>
                <installation_hresult></installation_hresult>
                <installation_hresult_text></installation_hresult_text>
                <reboot_required>false</reboot_required>
        </update>
        </updates>
        <result>
                <search_result>Succeeded</search_result>
                <return_code>0</return_code>
                <return_text></return_text>
                <reboot_required>false</reboot_required>
        </result>
</wuinstall>

/includeRecommendedUpdates

Includes recommended and optional updates.

/IncludePotentiallySupersededUpdates 0|1

Includes potentially superseded updates.

/disable_ie_firstruncustomize

Disables the Internet Explorer 8 set up dialog.

/targetgroup "targetgroup" 

One of the nice things about WSUS is that it allows you to use client side targeting. The idea behind client side targeting is that you can set up different computer groups, and you can roll out updates on a group basis. Client side targeting isn’t used by default, but if you decide to use it, you can use this option to assign the computer to a target group.

/offlinescan "scanfile"

This option can be used to search for updates against a cab-file. You can download the cab-file from the following link:

http://go.microsoft.com/fwlink/?LinkID=74689

The .cab file must be on a local directory, a UNC path won't work. We suggest copying the .cab file into a local directory before executing WuInstall.

This can be used to update computers, which don't have access to a WSUS, or to the internet. Therefore you have to combine it with the /install_cache option. First all updates have to be downloaded to the cache directory.

You have to execute WUInstall as administrator to use this option, otherwise it won't work.

/options [file://]|[http://]path

This options allows it to specify the options in a file which is either on the disk (use file://) or available on the internet (use http://).

In the options-file each option have to be in a separate line.

/tempdir "path"

Use this option to set the temp directory to the given path. By default the temp directory is set to %temp%.

/force

This option forces the update installation.

/third_party_progress tag 

This option adds additional output. Each line will start and end with the given tag. This makes it easier to parse the output.

Following lines will be added:

After searching and applying filters: %d updates matching filter - %d represents the number of matching updates

Before each download: starting download %d/%d, (%s) - %d/%d for example starting download of the first of three (1/3) updates, (%s) the uuid of the current update

After each download: finished download %d/%d, (%s) - %d/%d for example finished download of the first of three (1/3) updates, (%s) the uuid of the current update

Before each installation: starting install %d/%d, (%s) - %d/%d for example starting install of the first of three (1/3) updates, (%s) the uuid of the current update

After each installation: finished install %d/%d, (%s) result=%s - %d/%d for example finished install of the first of three (1/3) updates, (%s) the uuid of the current update, result=%s result status for the current installation

Last line of output: return code: %d - %d overall return code from WuInstall

For the installation output the /show_progress have to be used additionally.

/refresh_last_update_timestamp

This option refreshes the timestamps for the last successful search/install, which will be displayed in the Windows Update center.

/UseUpdateService MicrosoftUpdate|WindowsUpdate|WSUS|Default

This option sets the specified service which will be used for searching for updates.

/customActionBefore

WuInstall will execute the given action before it executes the other commands.

/customActionAfter

WuInstall will execute the given action after it has finished all other commands.

/checkAvailableDiskSpace drive_key:min_free_space(KB|MB|GB) 

This option checks if the given drive has at least the specified amount of free space otherwise WuInstall will terminate with the return code 17 - NOT_ENOUGH_DISK_SPACE.

/info

This option prints the xml output after wuinstall has finished. It can also be used without any other command to display system information in xml format.

/retrycount

Specifies the number of retries on search failure.

Use this option when you try to update a machine which gets a lot of updates from a WSUS server. Obtaining a lot of updates from a WSUS can cause a search to fail (because of a limit from the WSUS which is not configurable). Perform multiple searches to get a result.

/extended_error

Use this option to get a more specific return code as a bitmap:

  • 1: Set if an error occured
  • 2: Set if updates where found which mach the specified filter
  • 4: Set if updates where found
  • 8: Set if the maxUpdateCount was reached
  • 16: Set if a reboot is required
  • 32: Set if the timeout was reached
  • 64: Set if an invalid criteria was specified
  • 128: Set if there was a syntaxerror in the commandline
  • 256: Set if the license is invalid
  • 512: Set if there is not enough disk space