Help Determining OS

Author Message
Shayne

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 12/14/2011
  • Status: offline
Help Determining OS Thursday, December 15, 2011 12:05 AM (permalink)
0
HI,
 
I am working on a VBS logon script but before it runs the main bulk of the script I want to be able to check the OS the user is logging into so that the script does not run on Server versions. I have found a way to get the information about the OS but if I run the code on Windows 7 and Server 2008 R2 they report the same version number. I there another way to differentiate to two OS's?


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems
Wscript.Echo objOperatingSystem.Caption & " " & _
objOperatingSystem.Version
Next

Thats what I am using at the moment.
 
#1
    ebgreen

    • Total Posts : 8227
    • Scores: 98
    • Reward points : 0
    • Joined: 7/12/2005
    • Status: offline
    Re:Help Determining OS Thursday, December 15, 2011 3:57 AM (permalink)
    0
    Look at the caption property instead of the version.
    "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
    Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
    http://www.visualbasicscript.com/m_47117/tm.htm
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9