IVMVirtualMachine::AutoStartAtLaunch property

The AutoStartAtLaunch property contains whether this virtual machine will start up automatically when Virtual Server is launched.

This property is read/write.

Syntax

HRESULT put_AutoStartAtLaunch(
  [in]  VMAutoStartType autoStartAtLaunch
);

HRESULT get_AutoStartAtLaunch(
  [out] VMAutoStartType *autoStartAtLaunch
);

VB
VMVirtualMachine.AutoStartAtLaunch( _
  ByRef autoStartAtLaunch, _
  ByVal autoStartAtLaunch _
)

Property value

Contains a flag indicating whether this virtual machine will start up automatically when Virtual Server is launched.

This property value is read/write.

Error codes

Name Meaning
S_OK
The operation was successful.
E_POINTER
The autoStartAtLaunch parameter is NULL.
E_INVALIDARG
The autoStartAtLaunch parameter is not valid.
E_FAIL
The RunAsDefinedAccount property must be set to TRUE in order to enable AutoStart.
VM_E_VM_UNKNOWN
The configuration is unknown.
DISP_E_EXCEPTION
An unexpected error has occurred.

Remarks

By default, a virtual machine will start up automatically if it was running when Virtual Server was quit.

Examples

The following example displays the AutoStartAtLaunch property value of a IVMVirtualMachine object.

Set objVS = CreateObject("VirtualServer.Application")
Set objVM = objVS.FindVirtualMachine("Windows Server 2003")

Wscript.Echo "VM Name: " & objVM.Name
WScript.Echo "Autostart at launch: " & objVM.AutoStartAtLaunch

Requirements

Product
Microsoft Virtual Server 2005 onWindows Server 2003
Download
Microsoft Virtual Server 2005 R2 SP1 Update onWindows Server 2008orWindows Server 2003
Header
VsComInterfaces.h

See also

IVMVirtualMachine

VMAutoStartType