Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Detect OS version

0 views
Skip to first unread message

Steve VanSlyck

unread,
Feb 22, 2010, 8:53:13 AM2/22/10
to
In the following NetWare 6.5 login script, how would I differentiate between XP (as in WINNT in the "IF OS =" line) and Windows 7?
 
 
REM IN THE FOLLOWING CODE THE # IS A RUN COMMAND FOR THE PROGRAM
IF OS = "WINNT"
   WRITE "Checking Novell Client revision level . . . ."
   #\\Server\sys\PUBLIC\CLIENT\NWClient XP-4.91\acu.exe
   IF "%ERROR_LEVEL" = "1" THEN
        EXIT
   END
END

Simon Flood

unread,
Feb 22, 2010, 9:56:17 AM2/22/10
to
On 22/02/2010 13:53, Steve VanSlyck wrote:

> In the following NetWare 6.5 login script, how would I differentiate
> between XP (as in WINNT in the "IF OS =" line) and Windows 7?

XP, Vista and Windows 7 all return WINNT for the OS variable. However
you can additionally test the OS_VERSION variable since that is
different - XP = V5.01 (2000 was V5.00), Vista = V6.00 and Windows 7 =
V6.01.

So your login script becomes

> REM IN THE FOLLOWING CODE THE # IS A RUN COMMAND FOR THE PROGRAM
> IF OS = "WINNT"

IF OS_VERSION = "V5.01"


> WRITE "Checking Novell Client revision level . . . ."
> #\\Server\sys\PUBLIC\CLIENT\NWClient XP-4.91\acu.exe
> IF "%ERROR_LEVEL" = "1" THEN
> EXIT
> END
END

> END

HTH.
--
Simon
Novell Knowledge Partner (NKP)

------------------------------------------------------------------------
Do you work with Novell technologies at a university, college or school?
If so, your campus could benefit from joining the Novell Technology
Transfer Partners (TTP) group. See www.novell.com/ttp for more details.
------------------------------------------------------------------------

Steve VanSlyck

unread,
Feb 22, 2010, 2:05:27 PM2/22/10
to
Like this? Is this the correct syntax - "V5.01" and "V6.7.7600"?
 
Because on my W7 worksation, VER reports "Microsoft Windows [Version 6.1.7600]" and I dasn't attempt a network login until I'm sure the script is right.
 
IF OS = "WINNT"

   WRITE "Checking Novell Client revision level . . . ."

         IF OS_VERSION = "V5.01"

         #\\Server\sys\PUBLIC\CLIENT\NWClient XP-4.91\acu.exe
         IF "%ERROR_LEVEL" = "1" THEN
         EXIT
         IF OS_VERSION = "V6.1.7600"
         #\\Server\sys\PUBLIC\CLIENT\NWClient W7-2.00\acu.exe

         IF "%ERROR_LEVEL" = "1" THEN
         EXIT
   END
END

Steve VanSlyck

unread,
Feb 22, 2010, 2:10:09 PM2/22/10
to
Windows OS Version Numbers
 
Published on 17 August 2009 by Nirmal in Windows Tips Advertisements
 
Each version of Windows OS released by Microsoft has a particular version number and these version numbers are important for application developers while building application with compatibility. The OS version numbers actually contains different sections which are mentioned in OSVERSIONINFO structure in windows. OSVERSIONINFO contains three parts namely Major Version (dwMajorVersion), Minor Version (dwMinorVersion) and Build # (dwBuildNumber).
 
A list of all Windows OS from Microsoft and their version numbers may be found at http://www.nirmaltv.com/2009/08/17/windows-os-version-numbers/

Steve VanSlyck

unread,
Feb 23, 2010, 8:16:11 AM2/23/10
to
So the correct IF lines would be these, then?
 
         IF OS_VERSION = "V5.01" (for XP)
         IF OS_VERSION = "V6.01" (for Windows 7)

>>> smflood<smf...@no-mx.forums.novell.com> 2/22/2010 15:36 >>>
You're mixing two possible options - OS_VERSION will return V5.01 forXP and V6.01 for Windows 7.  However you can also test WINVER which willreturn versions in the form V6.1.7600.

Steve VanSlyck

unread,
Feb 23, 2010, 8:55:49 AM2/23/10
to
Script is not pausing. It writes the "Checking Novell Client revision left" and then continues on with the remaining MAP commands. Do you think I need to test for the higher version level first (despite the use of the = sign)?
 

WRITE "Checking Novell Client revision level . . . ."
      IF OS_VERSION = "V5.01"
      WRITE "Windows XP detected . . . ."

      #\\Server\sys\PUBLIC\CLIENT\NWClient XP-4.91\acu.exe
      IF "%ERROR_LEVEL" = "1" THEN
      EXIT
      IF OS_VERSION = "V6.01"
      WRITE "Windows 7 detected . . . ."
PAUSE

Steve VanSlyck

unread,
Feb 23, 2010, 9:02:25 AM2/23/10
to
Note - Despite use of the = sign, OS_VERSION levels must be checked in descending order, i.e.,
 
REM Test for W7
IF OS_VERSION = "V6.01"
<code>
EXIT
REM Test for XP
IF OS_VERSION = "V5.01"
<code>
EXIT
 
and so on
0 new messages