Vmrun batch file execution

From VI-Toolkit
Revision as of 19:02, 20 December 2008 by Wila (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In order to use vmrun to run a batch file on a Windows guest, you can use RunProgramInGuest and explicity call cmd.exe with the /c switch.

vmrun -T ws -gu USERNAME -gp PASSWORD runProgramInGuest "C:\Virtual Machines\WinXP2\WinXP2.vmx" %COMSPEC% "/c C:\batch.bat"

This command will issue %COMSPEC%, which is a pointer to cmd.exe, to run the batch file C:\batch.bat on the WinXP2 virtual machine.