Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a need to launch a Windows Virtual PC on Windows 7 as a scheduled task overnight, so that it can get Microsoft patches and antivirus updates. This needs to happen while nobody is logged onto the host system. I get Access Denied when I try to run a task to do this.

share|improve this question

migrated from Mar 2 '12 at 16:47

This question came from our site for system and network administrators.

I'd recommend to: 1) re-specify the account and a working password for the task; 2) use procmon to see where the error happens. – ivan_pozdeev Mar 1 '12 at 13:12

Below are the steps I went through to get this working. Thanks to Zdenek Brydl for his breakthrough post on the Windows forums, which set me in the right direction.


By default, Virtual PC is locked down so that it can only be run by an interactive user. This means you won’t be able to launch it as a background task without modifying the DCOM configuration.

  1. Run Regedit.exe and browse to "HKEY_CLASSES_ROOT\Wow6432Node\AppID{f375390d-5d01-4106-ae15-674be971c676}" key. This is the key for Virtual PC on a 64-bit Windows 7 system. (On a 32-bit system it should be "HKEY_CLASSES_ROOT\AppID{f375390d-5d01-4106-ae15-674be971c676}")
  2. Right-mouse click on the {f375390d-5d01-4106-ae15-674be971c676} key and select Permissions...
  3. Click the Advanced button in the Permissions window and select the Owner tab. Under Change owner to select the local Administrators group and click on Apply, then OK.
  4. Then under Permissions window, select the local Administrators group and under Permissions for Administrators select Full Control and click on Apply, then OK.
    • NOTE: DO NOT modify/change any permissions for the TrustedInstaller account as this is the default permission and could cause more problems later if changed or removed.
  5. Now run the Component Services management console (dcomcnfg.exe) and you should be able to modify some settings for Virtual PC.
  6. Navigate to Component Services – Computers -- My Computer – DCOM configuration – Virtual PC.
  7. Right-click and select Properties. In the Property dialog, click on the Identity tab and select “The launching user”.
  8. On the Security tab select Customize and click Edit to add the correct user account (local Administrator in my case) to Launch and Activation, Access and Configuration permissions.

After making these changes then you will be able to setup a scheduled task to launch a VM as the local Administrator or other account you’ve configured. There are several ways to do this, but it’s easiest to create a batch file that simply launches the .VMCX file (VM configuration file) for the VM that you want. Then your scheduled task will just run that batch file. Alternatively you can put it in a Powershell script (PS1) file and have the task run Powershell with that script as the argument. I went with that option.

Caveat / Warning

Once your scheduled task has launched the VM, it will become unavailable to any other users who happen to log onto the host machine interactively and want to use it. So, you’ll want to make sure you do this during slow hours, and you will also want to set up a scheduled task on the VM to have it shut itself down after a certain period. If you leave it running it will continue to eat up system resources on the host, and will be useless to the interactive users.

share|improve this answer

You can setup a scheduled task to run Virtual PC.exe (whether user is logged in our not).

Step one is to build the command line to start the VM:

Step two is to build the command line to stop the VM

Step three is to schedule the two scripts. Be sure to set the authenticating user & password and to use highest privileges available.

share|improve this answer
Sorry I have clarified my question now - this is on Windows 7. I believe these links are referring to Windows Virtual PC 2007, which does not run on Windows 7 and is very different from the Windows 7 version. The version that runs on Windows 7 is the technology that enables "XP Mode," and it does not have all the command line options you are referring to here. Anyway, I was able to get this working and will post the answer here shortly. Thanks. – Dmart Mar 1 '12 at 6:44

You must log in to answer this question.

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