' copies of the Software, and to permit persons to whom the Software is
' furnished to do so, subject to the following conditions:
'
' The above copyright notice and this permission notice shall be included in
' all copies or substantial portions of the Software.
'
' The names "VMware" and "VMware, Inc." must not be used to endorse or
' promote products derived from the Software without the prior written
' permission of VMware, Inc.
'
' Products derived from the Software may not be called "VMware", nor may
' "VMware" appear in their name, without the prior written permission of
' VMware, Inc.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
' VMWARE,INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
' IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
' CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
'
' ------
'
' This program is for educational purposes only.
' It is not to be used in production environments.
'
' Description:
'
' This script gets a list of virtual machines registered on
' the local server. It attempts to power-on each VM that
' is not already running and has a line in the config file:
'
' autostart=true
'
'
' Instructions for Windows 2000 and Windows XP host:
'
' - save the contents of this file to a file named 'sample3.vbs'
'
' - there should be an accompanying file named 'sample3.wsf'
' It is placed in the same directory as this file during
' product installation. This file is responsible for setting
' up the Windows Script Host environment and loading the
' VmCOM type library, thereby enabling this script to
' reference symbolic constants such as vmExecutionState_On
'
' - in a command line window, type:
' cscript //nologo sample3.wsf
'
Set connect_params = CreateObject("VmCOM.VmConnectParams")
' By default, connects to the local server.
' To connect to a remote server, uncomment these lines and set
' the values appropriately.
'
' connect_params.hostname = "<host>"
' connect_params.username = "<user>"
' connect_params.password = "<password>"
'
' And use this if your port number is different
' connect_params.port = 902
Set vm_server = CreateObject("VmCOM.VmServerCtl")
' Handle errors non-fatally from here on
On Error Resume Next
'
' Try connecting to server a few times. It's possible the VMware services
' are still in the process of starting up. We'll wait a maximum of
' 12 * 10 = 120 seconds = 2 minutes
'
connected = false
for tries = 1 to 12
vm_server.Connect connect_params
if Err.number = 0 then
= 2 minutes
DN-ree w"l"+Pncluded in
// sample3.IxG
//
// ------tC2863C385E30}#1.0#0"; "MSFLXGRD.OCX --Btion VB.Form MiniMUIForm t_parCa OR OTTTTTTTTT= ew RegExp Mini-MUI thi s = s & " UNA -----CliuctHe TTT= ew8280-----CliuctLeftTTTTTT= ew60-----CliuctTopTTTTTTT= ew345-----CliuctWidervTTTT= ew6960-----LinkTopionTTTTTT= ew MiniMUI -----ShiseHe TTTT= ew8280-----ShiseWidervTTTTT= ew6960-----word>UpPosie", norew3 Ree, to anDe is
-----Btion VB.C copy,Butt, ne confiLso, Cmdfrom hereCa OR OTTTTTTTTT= ew cript gets so, subjectVmNames
LeftTTTTTTTTTTTT= ewRRAhe proceTabIramxTTTTTTTT= ew50he proceTopTTTTTTTTTTTTT= ew588the proceWidervTTTTTTTTTT= ew1815mNameEnd-----Btion VB.C copy,Butt, nbuildCmdfrom hereCa OR OTTTTTTTTT= ew BuildVmNames
He TTTTTTTTT= ew255mNames
LeftTTTTTTTTTTTT= ew588the proceTabIramxTTTTTTTT= ew49he proceTopTTTTTTTTTTTTT= ew588the proceWidervTTTTTTTTTT= ew975mNameEnd-----Btion VB.C copy,Butt, nplatloamCmdfrom hereCa OR OTTTTTTTTT= ew PlatloamVmNames
He TTTTTTTTT= ew255mNames
LeftTTTTTTTTTTTT= ew444the proceTabIramxTTTTTTTT= ew48he proceTopTTTTTTTTTTTTT= ew588the proceWidervTTTTTTTTTT= ew1335mNameEnd-----Btion VB.C copy,Butt, npMware Cmdfrom hereCa OR OTTTTTTTTT= ew PMware VmNames
He TTTTTTTTT= ew255mNames
LeftTTTTTTTTTTTT= ew3n the proceTabIramxTTTTTTTT= ew47he proceTopTTTTTTTTTTTTT= ew588the proceWidervTTTTTTTTTT= ew1335mNameEnd-----Btion VB.C copy,Butt, nlt,crip connCmdfrom hereCa OR OTTTTTTTTT= ew G copies oo the locVmNames