Winscripter
  WSH
  Forums
  Downloads
  Books
  Links
  Amazon




Login
Register

© winscripter.com
1998-2004







Script: Determines Current Service Pack by Reading the Registry

Posted by on Monday, January 19, 2004 (PST)

Script: Reads registry to determine the current installed service pack.

 

 
/**
 *     Script:  CurrentServicePack.js
 *    Purpose:  Displays the current installed service pack (NT)
 *
 *     Author:  Daren Thiel
 *       Date:  25 March 2001
 *        Web: 
http://www.winscripter.com
 **/
 
 
function CurrentServicePack()
{
    try
    {
        var srvpk, regkey, shell;
 
        shell = new ActiveXObject( "WScript.Shell" );
        regkey = "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\CSDVersion";
        srvpk  = shell.RegRead( regkey );
  
        return( srvpk );
    }
    catch( e )
    {
        return( "Error: " + e.description );
    }
}
 
WScript.Echo( "Current Service Pack: " + CurrentServicePack() );
 

Add Your Comment



WSH and ADSI Administrative Scripting

New Articles
  • List installed COM objects and associated ProgIDs
    Script: Lists all COM Objects and their associated ProgIDs (If available). Win32_ClassicCOMClassSetting

  • Script: File Rotator
    Script: Rotate files where the most current file has the lowest number in the archive. When files exceed the retention period, they are deleted. Typically used for log files, backups, etc..

  • Script: Create IIS Website and DNS record
    Script: Dan Casier sent me this script that will create a website and appropriate DNS record. The script is intended for Windows 2000 Server with local DNS and necessary DNS mof installed.


  • Winscripter   |  WSH   |  Forums   |  Downloads   |  Books   |  Links   |  Amazon