Page 1 of 1 1
Topic Options
#41160 - 2003-06-06 02:04 PM Detecting operating system at logon
KCS Offline
Lurker

Registered: 2003-06-06
Posts: 2
Loc: Cincinnati
I am looking for a script example that checks theoperating system before performing the script. I current have an NT 4.0 Server and Client and Windows 2000 Professional Client. If the workstation is NT 40 I do not want the script to execute.
Top
#41161 - 2003-06-06 02:11 PM Re: Detecting operating system at logon
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
here is my logon.bat

You should be able to figure out the functionality of it.

code:
 
@ECHO OFF
cls
set areaserver=server1

VER | find "XP" > nul
IF not errorlevel 1 GOTO WinXP
VER | find "2000" > nul
IF not errorlevel 1 GOTO Win2K
VER | find "NT" > nul
IF not errorlevel 1 GOTO WinNT
GOTO END

:WinXP
xcopy \\%areaserver%\logon\kix32.exe %windir% /d /y /v >nul
%windir%\kix32.exe \\%areaserver%\logon\kixtart.kix
GOTO END
:Win2K
xcopy \\%areaserver%\logon\kix32.exe %windir% /d /y /v >nul
%windir%\kix32.exe \\%areaserver%\logon\kixtart.kix
GOTO END
:WinNT
xcopy \\%areaserver%\logon\kix32.exe %windir% /d /v >nul
%windir%\kix32.exe \\%areaserver%\logon\logon.kix
GOTO END
:WIN9X
GOTO END

:END

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#41162 - 2003-06-06 02:12 PM Re: Detecting operating system at logon
gandalf Offline
Lurker

Registered: 2003-06-06
Posts: 3
Loc: none
Hi,

check this ...

Select
Case $ProductType="LanmanNT"
$os="Windows NT Domain Controller"
Case (($ProductType="ServerNT") AND ($ProductSuite="Terminal Server|") AND ($TSEnabled=1))
$os="Windows 2000 Terminal Server"
Case (($ProductType="ServerNT") AND ($ProductSuite="Terminal Server|") AND ($TSEnabled=0))
$os="Windows 2000 Server"
Case (($ProductType="ServerNT") AND ($ProductSuite="Terminal Server|") AND ($TSEnabled=""))
$os="Windows NT Terminal Server"
Case (($ProductType="ServerNT") AND ($ProductSuite=""))
$os="Windows NT Server"
Case (($ProductType="WinNT") AND ($DOSVer="5.0"))
$os="Windows 2000 Workstation"
Case (($ProductType="WinNT") AND ($DOSVer="4.0"))
$os="Windows NT Workstation"
Case (($ProductType="WinNT") AND ($DOSVer="5.1"))
$os="Windows XP Professional"
Case ((@INWIN=2) AND ($DOSVer="4.10"))
$os="Windows 98"
Case ((@INWIN=2) AND ($DOSVer="4.0"))
$os="Windows 95"
EndSelect

$os includes the name of the OS.

for examble ...

If (($ProductType="WinNT") AND ($DOSVer="4.0"))
exit
else

endif

regards O.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 696 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.053 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org