Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > Scripting & Automation
  New Posts New Posts RSS Feed - Detecting windows version
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedDetecting windows version

 Post Reply Post Reply
Author
Message
anonymous View Drop Down
Groupie
Groupie


Joined: January 15 2004
Location: United States
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote anonymous Quote  Post ReplyReply Direct Link To This Post Topic: Detecting windows version
    Posted: January 07 2009 at 5:40am
Is there a Windows command that I can run with Accuterm to tell me if I'm running XP or Vista? I don't see it in any of the Accuterm subroutines.
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: January 07 2009 at 5:42am
There is currently no function that will return the Windows version running on the client PC. You could use a script using a Windows API function to return the version. Here's a sample:
SUBROUTINE ATGETWINVER(VER)

* SUBROUTINE TO GET WINDOWS VERSION USING ACCUTERM SCRIPT
*
* Returns platform (WIN9X or WINNT) followed by version number
*
* For example, Windows XP returns 'WINNT 5.1'
*
* Some known version numbers are:
*
* Windows 95: 3.95 or 4.0
* Windows 98: 4.10
* Windows ME: 4.90 (unverified)
* Windows NT4: 4.0
* Windows 2000: 5.0
* Windows XP: 5.1
* Windows Vista: 6.0
*
EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13), EM TO CHAR(25)
SCR = 'InitSession.Output GetWinVer() & vbCr'
SCR = SCR : EM : 'End Sub'
SCR = SCR : EM : 'Declare Function GetVersion Lib "Kernel32" () As Long'
SCR = SCR : EM : 'Function GetWinVer() As String'
SCR = SCR : EM : 'Dim lng As Long'
SCR = SCR : EM : 'Dim str As String'
SCR = SCR : EM : 'lng = GetVersion()'
SCR = SCR : EM : 'If lng < 0 Then'
SCR = SCR : EM : 'str = "WIN9X "'
SCR = SCR : EM : 'Else'
SCR = SCR : EM : 'str = "WINNT "'
SCR = SCR : EM : 'End If'
SCR = SCR : EM : 'str = str & CStr(lng And 255) & "." & CStr((lng And 65280) / 256)'
SCR = SCR : EM : 'GetWinVer = str'
SCR = SCR : EM : 'End Function'
SCR = SCR : EM : 'Sub Dummy'
PRINT ESC : STX : 'P' : SCR : CR :
ECHO OFF
PROMPT ''
INPUT VER:
PROMPT '?'
ECHO ON
RETURN
END


Thanks,

Pete
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.