How an application can detect if is running inside a Microsoft Virtual PC virtual machine
Wednesday, March 17, 2004
| 1 Comments
|
What if you are a developer and don't want your application to run in a VM? Or what if you want your application to install (or behave) in a different way when target OS is a virtual one?
Paul Adare, one Virtual PC Most Valuable Professional (MVP), wrote a simple WMI query that verify if you are running on a VM:
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32
_BaseBoard",,48)
For Each objItem in colItems
if objitem.Product = "Virtual Machine"
Thanks Paul!
© 2003-2008 virtualization.info
Sitemap
Sitemap


Comments
How can I do it in C#?
By
Anonymous, at Wednesday, January 25, 2006 1:58:00 PM
Post a new comment