[.vbs] OSInfo-v5.1+

Discussion in 'Scripting' started by 38956, Dec 14, 2010.

Tags:
  1. 38956

    38956 MDL Member

    Jun 7, 2010
    128
    134
    10
    #1 38956, Dec 14, 2010
    Last edited by a moderator: Apr 20, 2017
    [.vbs] OSInfoNT

    Windows Operating System information script (OSInfoNT.vbs)

    This VBScript will retrieve information about the Operating System, Software Licensing & Computer System via the Windows Management Instrumentation (WMI). The information will echo to screen with the option to save the information to a text file (.txt).


    • Requires Windows Version 5.1 (XP) or above
    • Tested on Windows XP, 7 and 8 (Release Preview & RTM: Core Edition)



    • The Windows Product Key is retrieved from the registry.
    • The Partial Product Key is retrieved via Software Licensing Product.

    • v1.01.112Beta : 21140601.7
      • Min Req Windows Version 5.1.
      • Software License Product: code updated
      • Computer Identification: code updated
      • Various other updates/changes
      • Sections Operating System information | Software Licensing Product information | Computer Identification information
    • v1.01.110Beta : 21140512.1
      • Product Key Function Code Updated to fix Windows 8 key issue with "N" in the key.
    • v1.01.109Beta : 21140511.7
      • Does Not Read Product Key Correctly In Windows 8/8.1 (Product Key issue with "N" in the key)
    • v1.01.107Beta : 21131107.4
      • Added function for Grace Period Remaining & Extended Grace for Windows Version 6.0+ ( day(s) / hour(s) / minute(s) )
      • Optional switch added for report only function (no echo). /output:file
    • v1.01.105Beta : 21131014.1
      • Updated: OS SKU and License Type / Channel
    • v1.01.103Beta : 21120923.7
      • Detect Windows XP Tablet PC Edition (Tested on Windows XP Tablet PC Edition 2005)
      • Removed Evaluation End Date from report for windows version 5.1
    • v1.01.102Beta : 21120626.2
      • Funtion code updated (Thanks to Daz) - Retrieve Windows 8 Product Key (from Registry)
    • v1.01.101Beta : 21120509.3
      • Script now uses Subroutines
      • Asks you if you want to save info to text file
      • Has optional command line switches (see OSInfoNT.vbs /cmd:switches)
      • Retrieves remote machine operating system information on LAN via switches (tested on home network only)
        • Please wait for the script to retrieve info from the remote machine!

    Download Link
    • v1.01.112Beta : 21140601.7 - http://www.datafilehost.com/d/eb87b1bd [SFX: self extracting archive]
      • SHA-256 : OSInfoNT_1.01.112Beta.exe - 32156C8A1F2E7984385A8375AFE3F6FAF6898280A14AA8786AC74166EE7849DE
      • SHA-256 : OSInfoNT_1.01.112Beta.vbs - 38E768A182E53898C6BF2825AEC8D501418D22A55EDC6C6544D9D6763A502977
    • v1.01.110Beta : 21140512.1 - http://www.datafilehost.com/d/89be960b [SFX: self extracting archive]
      • SHA-256 : OSInfoNT_1.01.110Beta.exe - 80DD1875C5F7B6D25CB66D08A33B6A265C5A6C5565A6EFAD5995079798C709ED
      • SHA-256 : OSInfoNT_1.01.110Beta.vbs - 9CECD4F17A1CB7506E17EF244488D409216AE536972CDE591B97CAF000CC61EF

    DOWNLOAD NOTE: Uncheck "Use our download manager" when downloading from DATA FILE HOST.

    File output: OSInfoNT6.1-Report.txt (example)
    Code:
    
      Operating System Information (OSInfoNT)
         for Windows Version 5.1 and above
    
      WinNT - WinVer: 5.1 and Above
    
        Script by: 38956  |  1.01.112Beta : 21140601.7
    
      ---------------------------------------------------------------------------------
        Operating System information
      ---------------------------------------------------------------------------------
      Product Name: Microsoft Windows 7 Professional 
      SKU: Professional Edition
      Edition ID: Professional
      CSD Version: Service Pack 1
      OS Architecture: 64-bit
    
      Windows Version:6.1Build:7601
      Build Lab:<REMOVED>
      Build Lab Ex:<REMOVED>
      Build Type:Multiprocessor Free
    
      OS Type: WinNTCountry Code:<REMOVED>
      Product Type: Workstation
      Primary OS: <REMOVED>
      Windows Directory: <REMOVED>
    
      Language: English - United States
      Locale: <REMOVED>
    
      Product ID: <REMOVED>
      Product Key: "<REMOVED>"
      License Type / Channel: 2 - OEM SLP / OEM_SLP
    
      Install Date: <REMOVED>
      Last Boot Time:  <REMOVED>
      Local Date/Time:  <REMOVED>
      Current Time Zone:  <REMOVED>
      ---------------------------------------------------------------------------------
      Registered Owner: <REMOVED>
      Organization: <REMOVED>
      ---------------------------------------------------------------------------------
    
    
      ---------------------------------------------------------------------------------
        Software Licensing Product information
      ---------------------------------------------------------------------------------
      Name:  Windows(R) 7, Professional edition
      Description: 
           Windows Operating System - Windows(R) 7, OEM_SLP channel
    
      Partial Product Key:  <REMOVED>
      License Status:       Licensed
      License Is Addon:     False
      Genuine Status:       Genuine   [ code 0 ]
    
      Grace Period Remaining:    .
      Extended Grace:    .
      Evaluation End Date:    .
      Remaining Windows Rearm Count:   <REMOVED>
      ---------------------------------------------------------------------------------
    
    
    
      ---------------------------------------------------------------------------------
        Computer Identification information
      ---------------------------------------------------------------------------------
      Computer System:
         Manufacturer:<REMOVED>
         Model:<REMOVED>    Name:<REMOVED>
         PC System Type:<REMOVED>    System Type:<REMOVED>
    
      Computer System Product:
         Vendor:<REMOVED>
         Name:<REMOVED>
         Version:<REMOVED>
         Identifying Number:<REMOVED>
         UUID:<REMOVED>
         SKU Number:
         Caption:<REMOVED>
         Description:<REMOVED>
    
      Base Board:
         Manufacturer:<REMOVED>
         Product:<REMOVED>
         Version:<REMOVED>
         Serial Number:<REMOVED> 
      ---------------------------------------------------------------------------------
    

    Let me know if you find the this script useful
     
  2. Calistoga

    Calistoga MDL Senior Member

    Jul 25, 2009
    420
    198
    10
    #2 Calistoga, Dec 14, 2010
    Last edited by a moderator: Apr 20, 2017
    I get this error when I run the scripts
    [​IMG]

    I can't see anything wrong with your version check though :confused:
    Code:
     If strRegWinVersion < 5.1 Then
       WScript.Echo "WINDOWS VERSION ERROR:" & vbCR _
        & "-------------------------------------------------------------" & vbCR _
        & "  This script requires Windows Version 5.1 (XP) or above!" & vbCR _
        & "-------------------------------------------------------------"
       WScript.Quit
     End If
    The strRegWinVersion variable correctly reports 6.1

    I've never taken the time to learn VBS, but maybe there is a problem with the data type of strRegWinVersion? If it's a string variable, the < operator wouldn't work?

    Edit: I should add that it works perfectly well when I remove the version check. Nicely done 38956 :)
     
  3. 38956

    38956 MDL Member

    Jun 7, 2010
    128
    134
    10
    #3 38956, Dec 14, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
    I've test it on my laptop which has win7 (6.1) and it works fine.


    Code:
     If strRegWinVersion < "5.1" Then
       WScript.Echo "WINDOWS VERSION ERROR:" & vbCR _
        & "-------------------------------------------------------------" & vbCR _
        & "  This script requires Windows Version 5.1 (XP) or above!" & vbCR _
        & "-------------------------------------------------------------"
       WScript.Quit
     End If
    Can you try adding quotes to 5.1 on the version check and see if it works

    or try this IF NOT

    Code:
     If Not strRegWinVersion => 5.1 Then
       WScript.Echo "WINDOWS VERSION ERROR:" & vbCR _
        & "-------------------------------------------------------------" & vbCR _
        & "  This script requires Windows Version 5.1 (XP) or above!" & vbCR _
        & "-------------------------------------------------------------"
       WScript.Quit
     End If
     
  4. Calistoga

    Calistoga MDL Senior Member

    Jul 25, 2009
    420
    198
    10
    Now we're talkin'

    The first solution worked :) Nice script dude
     
  5. wiz4rd

    wiz4rd MDL Novice

    Dec 19, 2010
    1
    0
    0
    Thx 4 share...nice script.
     
  6. Liebo

    Liebo MDL Member

    Jul 9, 2009
    133
    2
    10
    Does "on" mean that it should be showing the "Activate Windows" popup?

    On my Windows XP, it shows the activation notification as "on" however this is OEM and is active.
     
  7. 38956

    38956 MDL Member

    Jun 7, 2010
    128
    134
    10
    notification is ON = it will notify you when windows is not activated / not genuine

    you will only see notification when windows is not activated or is not genuine ect..
     
  8. Liebo

    Liebo MDL Member

    Jul 9, 2009
    133
    2
    10
    So if it were ever to be off, what would be happening in windows?
     
  9. 38956

    38956 MDL Member

    Jun 7, 2010
    128
    134
    10
    I don't know - i think if notification is OFF then you will not see any popups
     
  10. 38956

    38956 MDL Member

    Jun 7, 2010
    128
    134
    10
    Updated script - v1.01.101Beta : 21120509.3
     
  11. 38956

    38956 MDL Member

    Jun 7, 2010
    128
    134
    10
    Updated script - v1.01.102Beta : 21120626.2
     
  12. user_hidden

    user_hidden MDL Expert

    Dec 18, 2007
    1,026
    973
    60
    thank's for the update but shouldn't it be 20120626.2 ?
     
  13. 38956

    38956 MDL Member

    Jun 7, 2010
    128
    134
    10
    #13 38956, Jun 27, 2012
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Code:
    Century = 21
    Year (2 digit) = 12
    Month = 06
    Day = 26
    Day of Week = 2  (1 = Mon)
    
    21 12 06 26 .2
    I've been using this date system for years
     
  14. user_hidden

    user_hidden MDL Expert

    Dec 18, 2007
    1,026
    973
    60
    #14 user_hidden, Jun 27, 2012
    Last edited by a moderator: Apr 20, 2017
    I now understand the version scheme you are using.
     
  15. 38956

    38956 MDL Member

    Jun 7, 2010
    128
    134
    10
    v1.01.103Beta : 21120923.7

    updated script - v1.01.103Beta : 21120923.7
     
  16. Dos_Probie

    Dos_Probie MDL Senior Member

    Jul 18, 2012
    250
    84
    10
    Nice Scripting..Will add to my tools..:D
     
  17. 38956

    38956 MDL Member

    Jun 7, 2010
    128
    134
    10
    v1.01.105Beta : 21131014.1

    updated script - v1.01.105Beta : 21131014.1
     
  18. 38956

    38956 MDL Member

    Jun 7, 2010
    128
    134
    10
    v1.01.107Beta : 21131107.4

    updated script - v1.01.107Beta : 21131107.4
     
  19. 38956

    38956 MDL Member

    Jun 7, 2010
    128
    134
    10
    v1.01.109Beta : 21140511.7

    updated script - v1.01.109Beta : 21140511.7
     
  20. 38956

    38956 MDL Member

    Jun 7, 2010
    128
    134
    10
    #20 38956, May 12, 2014
    Last edited: May 12, 2014
    (OP)
    Does Not Read Product Key Correctly In Windows 8/8.1 (Product Key issue with "N" in the key)

    Checked OEM:DM Key via MSDM Table using RWEverything: Read & Write Everything