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)
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.
|
|
|
|
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)
Look at the caption property instead of the version.
|
|
|
|