IVMVirtualMachine::Name property
[Windows Virtual PC is no longer available for use as of Windows 8. Instead, use the Hyper-V WMI provider (V2).]
Retrieves and sets the name of the virtual machine configuration.
This property is read/write.
Syntax
HRESULT put_Name(
[in] BSTR virtualMachineName
);
HRESULT get_Name(
[out, retval] BSTR *virtualMachineName
);
Property value
Specifies the name of the virtual machine configuration. The length of the name cannot be more than 80 characters and the total length of the fully qualified path that includes the virtual machine name configuration file cannot be more than MAX_PATH (260) characters.
Error codes
Name/value | Meaning |
---|---|
|
The operation was successful. |
|
The parameter is NULL. |
|
The parameter is not valid or is an empty string. |
|
The configuration is unknown. |
|
The virtual machine is running or saved. |
|
The virtualMachineName parameter is empty. |
|
The parameter contains too many characters. |
|
The parameter contains one of the following invalid characters "*?:<>/|\"". |
|
The specified name already exists as the name of another virtual machine. |
|
An unexpected error has occurred. |
Remarks
Virtual machine names are case-insensitive, e.g. "MyVM" and "myvm" refer to the same virtual machine. This is the default property for IVMVirtualMachine.
If VPC.exe is running and the VM is saved then setting the Name property will not succeed. If VPC.exe is not running and the VM is saved then setting the Name property will succeed when VPC.exe is next started.
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows 7 [desktop apps only] |
Minimum supported server |
None supported |
End of client support |
Windows 7 |
Product |
Windows Virtual PC |
Header |
|
IID |
IID_IVMVirtualMachine is defined as f7092aa1-33ed-4f78-a59f-c00adfc2edd7 |