I am struggling to make a Task Scheduler task successfully runs a batch file which contains a vmrun command to start a VM. I am using VMware Workstation 12.5 in a Win 7 x64 (unfortunaltely I cannot test in others). I already had searched on other websites (including stackoverflow) and tried different approaches but I really do not understand what is going on with this simple command.
The command I am using to start the VM is this:
vmrun start "C:\Virtual Machines\Windows7x64\Windows7x64.vmx"
What I did so far:
- run it in the command line to make sure it is working
- created a batch file with the command above and run (through command line and double-clicking on it) to make sure it is working
- created a task in Task Scheduler pointing to the bat file, configured with high privileges, run whether user is logged on or not
- when I run the task (manually or waiting for the schedule time) I can see that the task starts running, although the VM is not started ever, and after just more than 1 minute, the task is finished with Last Run Result 0x0 (which means it succeeded through this link: https://msdn.microsoft.com/en-us/library/windows/desktop/aa383604(v=vs.85).aspx)
I tried the same approach using the command to stop the VM and it works!
vmrun stop "C:\Virtual Machines\Windows7x64\Windows7x64.vmx" soft
Anything I am missing here? Same command runs through command line and running the batch file, although not from Task Scheduler. Any hints, please? Any details I am loosing to look at?