[windows2000] Re: Batch files/Logon Scripts

  • From: "Stephen Taylor" <Stephen.Taylor@xxxxxxx>
  • To: windows2000@xxxxxxxxxxxxx
  • Date: Wed, 27 Nov 2002 14:50:28 +0000

Thanks Glenn





"Sullivan, Glenn" <GSullivan@xxxxxxxxxxxxxx>
Sent by: windows2000-bounce@xxxxxxxxxxxxx
27/11/2002 13:36
Please respond to windows2000

 
        To:     "'windows2000@xxxxxxxxxxxxx'" <windows2000@xxxxxxxxxxxxx>
        cc: 
        Subject:        [windows2000] Re: Batch files/Logon Scripts



Here is one.  It uses GETTYPE from the resource kit:

<----------start----------->
@echo off
REM Batch file to detect operating system
REM ----------------------------------
if Windows_NT == %OS% goto WINNT
echo You are NOT running Windows NT (Windows 95/98 perhaps?)
goto END

:WINNT
gettype.exe

if errorlevel=9 goto FILENOTFOUND

echo You are running Windows NT.
echo More Specifically:
echo.


if ERRORLEVEL=8 goto EIGHT
if ERRORLEVEL=7 goto SEVEN
if ERRORLEVEL=6 goto SIX
if ERRORLEVEL=5 goto FIVE
if ERRORLEVEL=4 goto FOUR
if ERRORLEVEL=3 goto THREE
if ERRORLEVEL=2 goto TWO
if ERRORLEVEL=1 goto ONE

:FILENOTFOUND
echo.
echo Gettype not found.
echo.
goto END

:EIGHT
echo Windows NT [Enterprise/Terminal] Server Non-Domain Controller
goto END

:SEVEN
echo Windows NT [Enterprise/Terminal] Server Domain Controller
goto END

:SIX
echo Windows 2000 Server Domain Controller.
goto END

:FIVE
echo Windows NT Server Domain Controller.
goto END

:FOUR
echo Windows 2000 Server Non-Domain Controller.
goto END

:THREE
echo Windows NT Server Non-Domain Controller.
goto END

:TWO
echo Windows 2000 Professional installation.
goto END

:ONE
echo Windows NT Workstation.
goto END

:END
pause
<---------------------------End-------------------->

Glenn Sullivan, MCSE+I  MCDBA
David Clark Company Inc.


-----Original Message-----
From: Stephen Taylor [mailto:Stephen.Taylor@xxxxxxx]
Sent: Wednesday, November 27, 2002 5:59 AM
To: windows2000@xxxxxxxxxxxxx
Subject: [windows2000] Batch files/Logon Scripts


Hi There

Is there a command I can use with in a batch file/logon script that will 
check which OS is on the pc in which it is running?

Thanks in advance

Stephen


****************************************************************************
*********
This email may contain confidential and privileged material for the sole 
use of the intended recipient. Any review, use, distribution or disclosure 

by others is prohibited. If you are not the intended or authorised 
recipient please contact the sender by reply email and delete all copies 
of this message


==================================
To Unsubscribe, set digest or vacation
mode or view archives use the below link.

http://thethin.net/win2000list.cfm

==================================
To Unsubscribe, set digest or vacation
mode or view archives use the below link.

http://thethin.net/win2000list.cfm






*************************************************************************************
This email may contain confidential and privileged material for the sole 
use of the intended recipient. Any review, use, distribution or disclosure 
by others is prohibited. If you are not the intended or authorised 
recipient please contact the sender by reply email and delete all copies 
of this message


==================================
To Unsubscribe, set digest or vacation
mode or view archives use the below link.

http://thethin.net/win2000list.cfm

Other related posts: