Microsoft KB Archive/309620

= INFO: Detect Microsoft Virtual Machine by Using Script =

Article ID: 309620

Article Last Modified on 10/20/2003

-

APPLIES TO


 * Microsoft virtual machine 31xx Series
 * Microsoft virtual machine 32xx Series
 * Microsoft virtual machine 33xx Series
 * Microsoft virtual machine 38xx Series
 * Microsoft Internet Explorer 5.0
 * Microsoft Internet Explorer 5.01
 * Microsoft Internet Explorer 5.5
 * Microsoft Internet Explorer (Programming) 6.0

-



This article was previously published under Q309620



SUMMARY
Internet Explorer can detect product components and versions, including Microsoft virtual machine (Microsoft VM).

The code sample in this article demonstrates how to determine if Microsoft VM is installed and, if it is installed, the Microsoft VM version.



MORE INFORMATION
You can use the code sample in this section to detect Microsoft VM without invoking it. This code sample assumes that Internet Explorer is the browser. The code sample then determines if Microsoft VM is installed and if so, what the version number is. If Microsoft VM is not installed, or if the Microsoft VM version is outdated, you are redirected to the Microsoft VM installer page at http://windowsupdate.microsoft.com    @media all { IE\:clientCaps {behavior:url(#default#clientcaps)} }   

 

if ( &quot;Microsoft Internet Explorer&quot; == navigator.appName ) {  //Running in Internet Explorer.

if ( (sMSvmVersion = oClientCaps.getComponentVersion(&quot;{08B0E5C0-4FCB-11CF-AAA5-00401C608500}&quot;, &quot;ComponentID&quot;) ) ) {  //Microsoft VM is present.

if ( &quot;5,0,3802,0&quot; == sMSvmVersion ) {  //The current version of Microsoft VM is installed; no action is needed.

document.write (&quot;The most recent version of Microsoft VM is installed on this computer.&quot;); //Redirect to the working page. } else {  //An older version of Microsoft VM is installed. Redirect for update.

document.write(&quot;The most recent version of Microsoft VM is not installed on this computer.&quot;); versionText; window.setTimeout ( &quot;redirector&quot;, 10000 ); }

} else {  //Microsoft VM is not present.

document.write(&quot;Microsoft VM is not installed on this computer.&quot;); versionText; window.setTimeout( &quot;redirector&quot;, 10000 ); }   } else { //Not running in Internet Explorer. document.write(&quot;This browswer is &quot; + window.navigator.appName + &quot;&quot; ); document.write(&quot;Microsoft VM is not available for this product.&quot;); }

function redirector {   window.open (&quot;http://windowsupdate.microsoft.com&quot;); }

function versionText {   if ( navigator.userAgent.indexOf(&quot;Windows NT 5.1&quot;) >  -1 ) {  //Running on Windows XP. Will be redirected to Windows Update version 4.

document.write(&quot;A second browser window will open to http://windowsupdate.microsoft.com in 10 seconds.<BR><BR>&quot;); document.write(&quot;<OL>&quot;); document.write(&quot;<LI>Choose 'Scan for Updates'. This will take a few seconds to complete.</LI>&quot;); document.write(&quot;<LI>The latest Microsoft VM is installed by the 'Security Update, August 2, 2001' in the 'Critical Updates' section.</LI>&quot;); document.write(&quot;<LI>Click 'Review and install updates'.</LI>&quot;); document.write(&quot;<LI>Click 'Install Now'.</LI>&quot;); document.write(&quot;<LI>After you review the License Agreement, click 'Accept'.</LI>&quot;); document.write(&quot;</OL>&quot;); document.write(&quot;<BR>Please reference Microsoft Knowledge Base article Q306525 to configure Windows XP to automatically look for product updates.<BR>To review this article, type 'MSKB Q306525' in the Address bar of Internet Explorer.<BR>&quot;); } else {  //Not Running on Windows XP, will be redirected to standard Windows Update

document.write(&quot;A second browser window will open to http://windowsupdate.microsoft.com</A> in 10 seconds.<BR><BR>&quot;); document.write(&quot;<OL>&quot;); document.write(&quot;<LI>Please click 'Product Updates' on the left side of the window.</LI>&quot;); document.write(&quot;<LI>If you are prompted to install Microsoft Windows Update Active Setup, click 'Yes'.</LI>&quot;); document.write(&quot;<LI>When this completes, one or more updates will be available.</LI>&quot;); document.write(&quot;<LI>Scroll down and then select 'Security Update, August 2,2001'.</LI>&quot;); document.write(&quot;<LI>Click 'Download' at the top of the page.</LI>&quot;); document.write(&quot;<LI>Click 'Start Download' to review your selection.</LI>&quot;); document.write(&quot;<LI>Click 'Yes' after you review the License Agreement.</LI>&quot;); document.write(&quot;</OL>&quot;); } }

</SCRIPT> </BODY> </HTML>

Keywords: kbinfo KB309620

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.