You can use the following command line parameters for optimizing an image.
VMwareOSOptimizationTool.exe
[-v]
[-r report_file_path_name]
[-o [default | all | recommended | mandatory | none]]
[-applyoptimization settings_file.json]
[-t template]
[-reboot | -shutdown]
where
| Parameter | Description |
|---|---|
-v |
Enables verbose mode to display detailed messages. |
[-r report_file_path_name] |
Saves the analysis report as a file with the specified name. |
[-o [default | all | recommended | mandatory | none]] |
Optimizes items with the specified level and above. If the -o parameter is not specified, there is no optimization performed. |
[-applyoptimization settings_file.json] |
Applies optimization based on the specified JSON file. The JSON file is created on the Optimize tab of the OS Optimization Tool UI. Follow steps 1 - 7 in the Optimize Image. |
[-t template] |
Specifies the template to be used for optimization. The template can be the name of a template in the default template repository or the abosulte path of a template file. If this parameter is not specified, the default template is used. |
[-reboot | -shutdown] |
Reboots or shuts down the computer after all operations have completed. |
Examples
- Generate an analysis report without performing any optimization
VMwareOSOptimizationTool.exe -r c:\reports\ - Optimize image using the default template and default selected items to optimize
VMwareOSOptimizationTool.exe -o - Optimize using the default template for only recommended and mandatory items. Show verbose messages.
VMwareOSOptimizationTool.exe -o recommended -v - Optimize by importing the optimization selections from a JSON file containing previously selected items
VMwareOSOptimizationTool.exe -o -v -applyoptimization my-settings.json- Optimize all default selected items using the specified VMware template
VMwareOSOptimizationTool.exe -o -t "VMware Templates\Windows 10 and Server 2016 or later" - Optimize all default selected items using the specified custom template
VMwareOSOptimizationTool.exe -o -t "My Templates\My Windows 10 or Server 2016 and later" - Optimize all default selected items using the specified template file
VMwareOSOptimizationTool.exe -o -t c:\temp\myTmpl.xml - Optimize using the default template and items selected by default. Write output to a file
VMwareOSOptimizationTool.exe -o -v > c:\temp\mylog.txt 2>&1
Controlling Common Options
You can specify common options while running the optimize command.
VMwareOSOptimizationTool.exe -o
[-v]
[-SyncHkuWithHkcu [enable | disable]]
[-visualeffect [performance | balanced | quality | enablehardwareacceleration]]
[-notification [enable | disable]]
[-windowsupdate [enable | disable]]
[-officeupdate [enable | disable]]
[-windowsSearch [enablecortana | searchboxasicon]]
[-storeapp [keep-all | remove-all [--exclude [Alarms | ScreenSketch | Camera | SoundRecorder | Calculator | StickyNotes | MSPaint | Photos | WebExtension]]]
[-background #000000]
[-firewall [enable | disable]]
[-antivirus [enable | disable]]
[-securitycenter [enable | disable]]
where
| Parameter | Description |
|---|---|
[-v] |
Enables verbose mode and displays detialed messages. |
[-SyncHkuWithHkcu [enable | disable]] |
Specifies whether to enable or disable synchronizing the HKCU (Current User) registry keys to the default user registry hive. The default user registry is used to create new user profiles. This parameter is enabled by default. |
[-visualeffect [performance | balanced | quality | enablehardwareacceleration]] |
Specifies the visual effects level.
|
[-notification [enable | disable]] |
Specifies whether system notifications are enabled or disabled. These include balloon tips, lock screen notification, and security and maintenance notifications. |
[-windowsupdate [enable | disable]] |
Specifies whether Windows Update is enabled or disabled. When enabled, Windows updates will be downloaded and installed. With non-persistent desktops, it is highly recommended to disable Windows updates and handle updates through the golden VM and pool updates. |
[-officeupdate [enable | disable]] |
Specifies whether to activate update service for Office 365, 2016 and 2019 (Click-to-Run). |
[-windowsSearch [enablecortana | searchboxasicon]] |
Specifies whether to enable Cortana and change the taskbar entry for Cortana to a magnifying glass.
|
[-storeapp [keep-all | remove-all [--exclude [Alarms | ScreenSketch | Camera | SoundRecorder | Calculator | StickyNotes | MSPaint | Photos | WebExtension]]] |
Specifies the Windows store applications to be removed.
|
|
|
Sets the background (wallpaper) to a solid color where #000000 is the hex value of the color. See https://htmlcolorcodes.com/color-names/ for a list of possible colors and corresponding hex values. |
|
|
Specifies whether to enable the Windows firewall. This enabled by default. |
|
|
Specifies whether to enable the OS built-in antivirus. This is enabled by default. |
[-securitycenter [enable | disable]] |
Specifies whether to enable the Security Center. This is enabled by default. |