Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Re: OS detection

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,2993
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Re: OS detection
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: <<   < prev  1 [2]
Login
Message << Older Topic   Newer Topic >>
 Re: OS detection - 5/18/2005 8:38:42 PM   
  littlebouda

 

Posts: 32
Score: 0
Joined: 5/13/2005
From: France
Status: offline
http://img281.echo.cx/my.php?image=contenuwbem5zu.jpg

--> Here is the content of my directory "wbem", but no wbemcode.dll.
Does it mean i haven't WMI? However, i can execute WMI script on my computer... [V]

(in reply to littlebouda)
 
 
Post #: 21
 
 Re: OS detection - 5/19/2005 1:29:56 AM   
  crazymatt

 

Posts: 296
Score: 0
Joined: 3/4/2005
From:
Status: offline
i think it should be \WBEM\wbemcore.dll (coRe instead of coDe)

/Matt

(in reply to littlebouda)
 
 
Post #: 22
 
 Re: OS detection - 5/20/2005 12:39:42 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Bah, sorry for the mistake, yes, it should be CORE and not CODE. I will correct it above.

Note to self, PROOFREAD.

(in reply to littlebouda)
 
 
Post #: 23
 
 Re: OS detection - 6/16/2005 1:56:02 PM   
  DragonMasterXX5

 

Posts: 52
Score: 0
Joined: 6/13/2005
From: USA
Status: offline
I think the script works best this way:

set WshShell = WScript.CreateObject ("WScript.Shell")
Winvers = WshShell.exec("%comspec% /c ver").stdout.readall
'wscript.echo Winvers
WinVers = Left(UCase(WinVers),22)
'wscript.echo Winvers
comp = Mid(WinVers, 21, 2)
'wscript.echo comp

Select Case comp
Case "95"
GetOS = "Windows 95"

Case "98"
GetOS = "Windows 98"

Case "ME"
GetOS = "Windows Millenium"

Case "20"
GetOS = "2000"

Case "NT"
GetOS = "Windows NT"

Case "XP"
GetOS = "Windows XP"

Case else : GetOS = "Unknown Operating System"

End Select
wscript.Echo GetOS

(in reply to littlebouda)
 
 
Post #: 24
 
 Re: OS detection - 6/16/2005 2:09:52 PM   
  tnoonan

 

Posts: 364
Score: 0
Joined: 12/14/2004
From:
Status: offline
ROFL TFF [:p]

(in reply to littlebouda)
 
 
Post #: 25
 
 RE: Re: OS detection - 7/13/2005 2:53:37 PM   
  406_sg

 

Posts: 2
Score: 0
Joined: 7/12/2005
Status: offline
this was what I was looking for. Many thanks for those who contributed.

(in reply to tnoonan)
 
 
Post #: 26
 
 RE: Re: OS detection - 7/13/2005 4:47:57 PM   
  cosi

 

Posts: 4
Score: 0
Joined: 7/13/2005
Status: offline
try this

strComputer = "."
Set objSystems = GetObject("WinMgmts:{impersonationlevel=impersonate}!//" & _
strComputer & "/root/CIMV2").InstancesOf("Win32_OperatingSystem")
For Each objSystem In objSystems
    MsgBox "" & objSystem.Caption & " Service Pack " & CStr(objSystem.ServicePackMajorVersion)
Next

(in reply to crazymatt)
 
 
Post #: 27
 
 
Page:  <<   < prev  1 [2]
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Re: OS detection Page: <<   < prev  1 [2]
Jump to:





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
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts