Windows XP OS reporting 
Author Message
 Windows XP OS reporting

I'm trying to find a way to get a script to report whether the OS installed
is Windows XP but so far have been unsuccessful.  The OS version the script
currently returns is Windows 2000!  Any help appreciated.


Sat, 08 May 2004 18:39:17 GMT  
 Windows XP OS reporting
Hi,

If you check the registry key
HKLM\Software\Microsoft\Windows NT\CurrentVersion\
the CurrentVersion value is 5.1 for XP and 5.0 for
Windows 2000.

Hope it helps.
\
Bruno

Quote:
>-----Original Message-----
>I'm trying to find a way to get a script to report

whether the OS installed
Quote:
>is Windows XP but so far have been unsuccessful.  The OS
version the script
>currently returns is Windows 2000!  Any help appreciated.

>.



Sat, 08 May 2004 20:46:18 GMT  
 Windows XP OS reporting
OS detection:

Set oShell = CreateObject("Wscript.Shell")

On Error Resume Next
sOSversion = oShell.RegRead(_
    "HKLM\SOFTWARE\Microsoft\Windows NT" & _
    "\CurrentVersion\CurrentVersion")

If Err Then
  ' Win9x/ME
ElseIf sOSversion = "4.0" Then
  ' WinNT 4.0
ElseIf sOSversion = "5.0" Then
  ' Win2000
ElseIf sOSversion = "5.1" Then
  ' WinXP
Else
      ' Unknown NT-based OS
End If
On Error Goto 0

--
torgeir

Quote:

> I'm trying to find a way to get a script to report whether the OS installed
> is Windows XP but so far have been unsuccessful.  The OS version the script
> currently returns is Windows 2000!  Any help appreciated.



Sun, 09 May 2004 01:46:42 GMT  
 Windows XP OS reporting
The code snippet provided by torgeir should work. Please try it on your
side.

Regards,



Sat, 15 May 2004 17:32:18 GMT  
 Windows XP OS reporting
Here is the code snippet provided by torgeir in another same post:

Set oShell = CreateObject("Wscript.Shell")

On Error Resume Next
sOSversion = oShell.RegRead(_
    "HKLM\SOFTWARE\Microsoft\Windows NT" & _
    "\CurrentVersion\CurrentVersion")

If Err Then
  ' Win9x/ME
ElseIf sOSversion = "4.0" Then
  ' WinNT 4.0
ElseIf sOSversion = "5.0" Then
  ' Win2000
ElseIf sOSversion = "5.1" Then
  ' WinXP
Else
      ' Unknown NT-based OS
End If
On Error Goto 0



Sat, 15 May 2004 17:35:41 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. windows xp and jscript - I cannot Install scriptgen with windows XP

2. Script to Mute Sound - Windows 2000 and Windows XP Systems

3. writing vbscript to know the OS of a remote PC ( is WIndows NT or WIndows 2000)

4. cdonts in Windows XP Pro

5. Writing print status in a file (windows xp)

6. Redmon GhostScript Windows XP - printer dialog

7. command line printer setup under windows xp

8. Appearance in Windows XP

9. VBS Commands run asynchron in Windows XP ?!

10. Turning Windows XP firewall on/off

11. compressed Files windows xp

12. command line printer setup under windows xp

 

 
Powered by phpBB® Forum Software