Vmrun batch file execution: Difference between revisions

From VI-Toolkit
Jump to navigation Jump to search
How to use vmrun to execute batch files in Windows Guests
 
No edit summary
 
Line 4: Line 4:


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.
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.
[[Category: VIX]]

Latest revision as of 19:02, 20 December 2008

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.