# vmWare - Run Guest Command: variable usage fails

**URL:** https://www.finalbuilder.com/forums/t/vmware-run-guest-command-variable-usage-fails/3600
**Category:** Bugs
**Created:** [October 2, 2015, 9:17am UTC](https://www.finalbuilder.com/forums/t/vmware-run-guest-command-variable-usage-fails/3600 "2015-10-02T09:17:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![finalbuilder](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/f/d07c76/32.png) [@finalbuilder](https://www.finalbuilder.com/forums/u/finalbuilder)
#### Post date: [October 2, 2015, 9:17am UTC](https://www.finalbuilder.com/forums/t/vmware-run-guest-command-variable-usage-fails/3600/1 "2015-10-02T09:17:45Z")

</div>

Hi Support Team,  
  
I have a FB 8 project to learn about vmWare actions and use  
- vmWare WorkStation Start  
- vmWare List Virtual Machines to get a list of running machines into variable %vm%  
- vmWare Execute Guest Command with  
&nbsp; – Virtual Machine Name %vm%  
&nbsp; – Command: Run a program in Guest OS  
&nbsp; – Arguments / Path: %WINDIR%\SYSTEM32\CMD.EXE  
&nbsp; – Arguments / Arguments: /c dir c:\windows\*.exe  
  
The action fails with “Error: Cannot open VM: D:\VMware\W7x64\W7x64.vmx, unknown file suffix”.  
  
In case I enter “D:\VMware\W7x64\W7x64.vmx” directly as Virtual Machine Name, I get another error:  
  
Command Output  
Guest program exited with non-zero exit code: 1  
&nbsp;  
Action Failed with Return Code : 1  
  
Would you mind to   
- check this (and other) action(s) to work proper with variables  
- give me a clue of what I need to change to get the command executed on the guest?  
  
All actions run with Host Type “vmWare WorkStation”.  
  
Best regards  
Michael

---

<div class="post-metadata">

### Author: ![finalbuilder](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/f/d07c76/32.png) [@finalbuilder](https://www.finalbuilder.com/forums/u/finalbuilder)
#### Post date: [October 2, 2015, 9:22am UTC](https://www.finalbuilder.com/forums/t/vmware-run-guest-command-variable-usage-fails/3600/2 "2015-10-02T09:22:46Z")

</div>

Ooops, forgot point one of my last post. I recognized that %vm% is a list variable and thus the filename has a \r\n at the end. Sorry for my carelessness…  
  
But point two is still open: the command is not executed.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [October 5, 2015, 1:59am UTC](https://www.finalbuilder.com/forums/t/vmware-run-guest-command-variable-usage-fails/3600/3 "2015-10-05T01:59:02Z")

</div>

It’s difficult to tell from the output… but my first guess would be permissions. Also, FinalBuilder expands the arguments before passing to vmrun, so if you use %WINDIR% in the action it will pass the value of WINDIR on the machine FinalBuilder is executing. That may be ok in this case since most machines have windows installed in c:\windows but it is something to be aware of.
