Now that Windows NT has many versions (NT 3.5x, NT 4.0, NT 5.0 (Windows 2000), and NT 5.1 (Windows XP)),
how do I determine which version my client is running, in a logon script?
If you only have NT 4.0 and NT 5.0, you could use tip 2405.
For a more enduring solution, I have scripted NTV.BAT, which returns an environment variable, NTV, containing the version number.
To use the script:
1. Copy NTV.BAT to the Netlogon share (an replicas).
2. Copy RegFree.exe to the Netlogon share.
3. If you have any Windows 9x or Windows ME clients, you may want to implement tip 1786.
4. In your logon script:
You can then test the NTV environment variable. Here is sample:
REM Windows XP here
if NOT "%OS%"=="Windows_NT" goto :EOF
for /f "Tokens=*" %%i in ('%LOGONSERVER%\Netlogon\regfree -Quiet -ListValue "hklm\Software\Microsoft\Windows NT\CurrentVersion\CurrentVersion"') do set NTV="%%i"
set NTV=%NTV:REG_SZ =%