[Samba] test

Jonathan Johnson jon at sutinen.com
Tue Jan 28 22:20:57 GMT 2003


Hello all,

>From a Windows NT, 2000, or XP command prompt (cmd.exe, NOT command.com) you
can see all of the system level environment variables available when
processing login scripts (and other programs) by issuing the "set" command.
Unfortunately, there is nothing there that specifically identifies the
version of Windows, although the variable %OS% shows up as "Windows_NT".

The command "ver" returns the version, but that's not really helpful,
because in a batch file script, you can't use the output to control the
direction of the script.

Here's a workaround, but it's going to take some running around on your
part. On each workstation, you can define your own environment variable, say
"WINVER=9x" for Windows 98 workstations, "WINVER=NT" for Windows NT 4.0,
"WINVER=2K" and so on. Then you can call %WINVER% from your login script.

These environment variables are defined in the (rt. click) My Computer -
Properties... look thru here for "environment variables." There are
user-level and system-level variables, you want to place WINVER in the
System variables. This setting will take effect the next time cmd.exe is
called, so you don't need to reboot.

Alternatively, the variables can be defined in the registry, in the
HKLM\System\CurrentControlSet\Control\Session Manager\Environment key.

--Jon
jon at sutinen.com

The above is in reply to the below:
>Date: Tue, 28 Jan 2003 08:17:36 -0800
>From: Kaleb Pederson <kpederson at mail.ewu.edu>
>Subject: [Samba] %windows_version?
>
>I was wondering if there was a %{char} that would give me the windows
>version or something equivalent so that Windows XP specific "stuff" doesn't
>get stuck with Windows 2000 "stuff".
>
>Thanks for the help.
>
>--Kaleb
>
>PS: Please CC me as I'm not on the list.



More information about the samba mailing list