On Windows guest operating systems, you can write scripts to automate guest operating system operations when you change the power state of a virtual machine.
For Windows guest operating systems, you can write new scripts or modify default scripts, save them with new names, and configure VMware Tools to use your custom script instead of the default script.
Scripts are run by the VMware Tools service, or daemon (vmtoolsd). Because vmtoolsd is run as System on Windows, the scripts are run in a separate session from the session of the logged-in user. The VMware Tools daemon does not detect desktop sessions, which means that it cannot display graphical applications. Do not attempt to use custom scripts to display graphical applications.
Prerequisites
- Familiarize yourself with the default VMware Tools scripts. See Default VMware Tools Scripts.
- If you plan to script commands and need to know what the exit codes are, see Exit Codes for the VMware Tools Configuration Utility.
Procedure
Results
The VMware Tools service runs the script whenever the specified power operation occurs.