JSI Tip 0643 - What type of Windows NT am I logged onto?


To determine the type of Windows NT that you are logged onto, download gettype.zip and unzip it. I have created a Gettype.bat that is CALLed in a login script:


@echo off
set ERRORLEVEL=
if /i %OS% == Windows_NT goto WINNT
set ERRORLEVEL=6
goto ERRL
:WINNT
%LogonServer%\netlogon\gettype.exe
:ERRL
set NTNUM=%ERRORLEVEL%
goto T%ERRORLEVEL%
:T6
SET NTTYPE="Unknown"
goto END
:T5
SET NTTYPE="Windows NT \[Enterprise/Terminal\] Server Domain Controller"
goto END
:T4
SET NTTYPE="Windows NT \[Enterprise/Terminal\] Server Non-Domain Controller"
goto END
:T3
SET NTTYPE="Windows NT Server Domain Controller"
goto END
:T2
SET NTTYPE="Windows NT Server Non-Domain Controller"
goto END
:T1
SET NTTYPE="Windows NT Workstation"
:END
The batch file returns two environment variables, NTNUM and NTTYPE which you can use.



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish