0

I want to "start" a virtual machine (it may be powered down or hibernating) via a scheduled task in Windows 7. I cannot figure the correct way to do this.

I tried scheduling the cmd task, which works if I run it manually.

cmd "x:\test1.vmcx"

None of the applications in the Virtual PC area of system32 seem to be working with arguments.

c:\windows\system32\vpc.exe "x:\test1.vmcx"
c:\windows\system32\vmwindow.exe "test1"
c:\windows\system32\vmwindow.exe "x:\test1.vmcx"

And I tried the VMSal command described here, without an application argument (I used my machine's 2nd param, not one listed in the command).

c:\Windows\System32\VMSal.exe "test1" "||2073a9cc"

3 Answers 3

0

Make a batch file with this in it:

"C:\path\to\VMWindow.exe" -file "C:\full\path\to\file.vmcx"

Replace values accordingly, as I do not know where your Virtual PC installation is situated. Keep the quotes just in case, as any path with spaces in it will break your batch script (ie: Virtual PC).

Save this and run the .bat file from task scheduler.

3
  • There is no virtualpc.exe in Windows Virtual PC (for Windows 7). There is a vpc.exe (the process that shows in Task Manager when VPC is running). The Start Menu shortcut "Windows Virtual PC" goes to vmwindow.exe. And XP Mode style application shortcuts are vmsal.exe. Dec 14, 2009 at 17:12
  • You'll want vmwindow
    – user1931
    Dec 14, 2009 at 17:34
  • I can execute the batch file from the command line, but it is not working from Scheduled Tasks even with highest privileges. Dec 14, 2009 at 21:24
0

I managed to create a PowerShell script that would execute the *.vmcx file in the Explorer registered application.

& 'x:\test1.vmcx'

I then registered the PowerShell executable as my task "action" and the path to this script as an "argument".

<path-to-ps>\powershell.exe x:\start-test1.ps1
2
  • Using just the script as the task "program" opens in Notepad... even though it has a PowerShell icon. I don't want to mess with this behavior, so I use the PowerShell program and argument. Dec 14, 2009 at 22:28
  • The command window closes after execution using the PS script! Dec 15, 2009 at 16:30
0

I managed to get a batch file to work. The batch file leans on Explorer.

x:\test1.vmcx

I just make it the "program" in the Scheduled Task action.

x:\start-test1.bat
1
  • I can't get the command window to disappear after execution... any thoughts? Dec 15, 2009 at 16:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .