Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 175326

How to get VM path to .vmx file when you have the VM name?

$
0
0

Hi All,

I'm using the latest release of VIX API to power on VMs on an ESX server. I'm working with C# in Visual Studio 2012 and currently, I power on the VM using the following code:

 

VMWareVirtualMachine virtualClientMachine = host.Open(vmMachinePath, 2100);

 

While this works, I think it's better to instead be able to power on the VM when you know the VM name and not the path. So, how can I get the VM path to the vmx file when I know the name of the VM? For example, if my VM on the ESX server is called WIN7GERMAN, how do I then get the path and pass this to the host.Open function?

 

Thanks for any help or code.

John


Viewing all articles
Browse latest Browse all 175326

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>