| « Lock Workstation on Startup | Microsoft's getVirtual Now » |
Script Virtual PC Virtual Machines to start
Both my web server and exchange server are running on Microsoft Virtual PC. I was getting tired of having the start the servers manually when restarting the host. I did some searching on the internet and came up with a VB script to fix the problem.
Here it is:
Option Explicit
Dim WSHShell, WSHShell1, WSHShell2
'Now launch virtual machine
Set WSHShell = CreateObject("Wscript.Shell")
WSHShell.Run Chr(34) & "C:\Program Files (x86)\Microsoft Virtual PC\Virtual PC.exe"
WScript.Sleep(5000)
Set WSHShell1 = CreateObject("Wscript.Shell")
WSHShell1.Run Chr(34) & "C:\Virtual Machines\VM name1.vmc"
Set WSHShell2 = CreateObject("Wscript.Shell")
WSHShell2.Run Chr(34) & "C:\Virtual Machines\VM name2.vmc"
I just saved this to a .vbs file and put it in my startup folder. Now when I log in after a restart the VMs will startup automatically. Now I just need to edit the registry to auto logon and create script to lock my computer after logon. This should save me from having to login after a windows update installing in the night.
This webpage helped me out: http://www.tek-tips.com/viewthread.cfm?qid=1484499&page=7
There sleep syntax was not right so I changed it to WScript.Sleep(5000). Without the sleep I could not get the VMS to start.
Feedback awaiting moderation
This post has 1 feedback awaiting moderation...