public sealed class VmRunWrapper : IDisposable
Public NotInheritable Class VmRunWrapper
Implements IDisposable
Dim instance As VmRunWrapper
public ref class VmRunWrapper sealed : IDisposable
[<SealedAttribute>]
type VmRunWrapper =
class
interface IDisposable
end
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Private vmRun As VmRunWrapper
Private Async Sub Test()
Me.vmRun = New VmRunWrapper("C:\Program Files (x86)\VMWare\VMware VIX\vmrun.exe")
Dim vmCount As Integer = Await Me.vmRun.GetRunningVmCountAsync()
If (vmCount > 0) Then
Dim vms As ReadOnlyCollection(Of VMWareVirtualMachine) = Await Me.vmRun.GetRunningVmsAsync()
For Each vm As VMWareVirtualMachine In vms
' A valid guest username and password (if any) is required in order to use some of the functionalities of vmrun.exe program.
vm.GuestOsCredential.Username = "guest username"
vm.GuestOsCredential.Password = "guest password"
' Check whether VMWare-Tools are installed in the VM.
' The VmWare-Tools are required by some of the functionalities of vmrun.exe program.
Dim isVMWareToolsInstalled As Boolean = Await Me.vmRun.IsVmWareToolsInstalledAsync(vm)
Console.WriteLine("VM Name: {0}; IsVMWareToolsInstalled: {1}'", vm.DisplayName, isVMWareToolsInstalled)
If Not isVMWareToolsInstalled Then
Me.vmRun.InstallVmWareTools(vm)
Continue For
End If
Try
' Run a program on the guest operating system.
Me.vmRun.ProcessRun(vm, "C:\program.exe", VmRunProgramFlags.NoWait Or VmRunProgramFlags.ActiveWindow Or VmRunProgramFlags.Interactive, "")
Catch ex As VmRunException
Throw
Catch ex As Exception
Throw
End Try
Next
End If
End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
VmRunWrapper | Initializes a new instance of the VmRunWrapper class. |
Exists | Gets a value indicating whether the VmRun.exe file Exists. |
FilePath | Gets the VmRun.exe file path. |
Process | Gets the VmRun.exeProcess instance. |
CaptureScreen | Capture the screen of the guest operating system of the specified virtual machine and save it to a image file (in .PNG format) in the host operating system. |
DirectoryCreate | Create a directory in the guest operating system of the specified virtual machine. |
DirectoryDelete | Delete a directory from the guest operating system of the specified virtual machine. |
DirectoryExists | Determine whether a directory exists in the guest operating system of the specified virtual machine. |
DirectoryExistsAsync | Asynchronously determine whether a directory exists in the guest operating system of the specified virtual machine. |
Dispose | Releases all the resources used by this instance. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
FileCopyFromGuestToHost | Copies a file from the guest operating system of the specified virtual machine to the host operating system. |
FileCopyFromHostToGuest | Copies a file from the host operating system to the guest operating system of the specified virtual machine. |
FileDelete | Delete a file from the guest operating system of the specified virtual machine. |
FileExists | Determine whether a file exists in the guest operating system of the specified virtual machine. |
FileExistsAsync | Asynchronously determine whether a file exists in the guest operating system of the specified virtual machine. |
FileRename | Rename a file in the guest operating system of the specified virtual machine. |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetIpAddress | Gets the IP address of the guest operating system on the specified virtual machine. |
GetIpAddressAsync | Asynchronously gets the IP address of the guest operating system on the specified virtual machine. |
GetRunningVmCount | Gets the amount of virtual machines that are running on the host operating system. |
GetRunningVmCountAsync | Asynchronously gets the amount of virtual machines that are running on the host operating system. |
GetRunningVms | Gets the file paths of the virtual machines that are running on the host operating system. |
GetRunningVmsAsync | Asynchronously gets the file paths of the virtual machines that are running on the host operating system. |
GetSnapshotCount | Gets the amount of snapshots created in the specified virtual machine. |
GetSnapshotCountAsync | Asynchronously gets the amount of snapshots created in the specified virtual machine. |
GetSnapshotNames | Gets the names of the snapshots created in the specified virtual machine. |
GetSnapshotNamesAsync | Asynchronously gets the names of the snapshots created in the specified virtual machine. |
GetSnapshotsTreeview | Gets a tree-view of the snapshots created in the specified virtual machine. |
GetSnapshotsTreeviewAsync | Asynchronously gets a tree-view of the snapshots created in the specified virtual machine. |
GetType | Gets the Type of the current instance. (Inherited from Object) |
InstallVmWareTools | Installs VmWare Tools on the guest operating system of the specified virtual machine. |
IsVmWareToolsInstalled | Gets a value that determine whether VmWare Tools is installed in the specified virtual machine. |
IsVmWareToolsInstalledAsync | Asynchronously gets a value that determine whether VmWare Tools is installed in the specified virtual machine. |
ProcessKill | Kills a running process from the guest operating system of the specified virtual machine. |
ProcessRun | Runs a new process in the guest operating system of the specified virtual machine. |
ProcessRunScript | Runs a script in the guest operating system of the specified virtual machine. |
ProcessRunScriptAsync | Asynchronously runs a script in the guest operating system of the specified virtual machine. |
SendKeystrokes | Send keystrokes to the guest operating system of the specified virtual machine. |
SharedFolderAdd(VMWareVirtualMachine, VmSharedFolderInfo) | Adds a new shared folder in the guest operating system of the specified virtual machine. |
SharedFolderAdd(VMWareVirtualMachine, String, String) | Adds a new shared folder in the guest operating system of the specified virtual machine. |
SharedFolderRemove(VMWareVirtualMachine, VmSharedFolderInfo) | Adds a new shared folder in the guest operating system of the specified virtual machine. |
SharedFolderRemove(VMWareVirtualMachine, String) | Adds a new shared folder in the guest operating system of the specified virtual machine. |
SharedFoldersDisable | Enable shared folders features in the guest operating system of the specified virtual machine. |
SharedFoldersEnable | Enable shared folders features in the guest operating system of the specified virtual machine. |
SharedFolderSetAccess(VMWareVirtualMachine, VmSharedFolderInfo, Boolean) | Sets the writable/readonly access of a shared folder in the guest operating system of the specified virtual machine. |
SharedFolderSetAccess(VMWareVirtualMachine, String, String, Boolean) | Sets the writable/readonly access of a shared folder in the guest operating system of the specified virtual machine. |
SnapshotCreate | Create a snapshot of the specified virtual machine. |
SnapshotDelete | Delete a snapshot from the specified virtual machine. |
SnapshotRestore | Revert the state of the specified virtual machine to the state of the specified snapshot. |
ToString | Returns a string that represents the current object. (Inherited from Object) |
VmDelete | Deletes the specified virtual machine. |
VmPause | Pause the specified virtual machine. |
VmReset | Reset the specified virtual machine. |
VmResume | Resume (unpause) the specified virtual machine. |
VmStart | Start the specified virtual machine. |
VmStop | Stop the specified virtual machine. |
VmSuspend | Suspend the specified virtual machine. |
CanConvertTo |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
CanConvertToT |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions) |
IsDisposable |
Determines whether the specified object is a disposable type
(i.e., it implements IDisposable interface).
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
ThrowIfNullTException |
Throws the specified exception if the source object is null.
(Defined by ObjectExtensions) |