Discussion Locked

Logon Batch file - Detect an OS

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I want to know how to configure my logon batch file to detect the Win95 and NT operating systems and not allow them on the network? If there is a better way that using the logon batch file please let me know.

Thanks,
Steve

2 replies

by erikdr

Batch is not a bad idea. You could do checks on the directory structure on C: and check for files that only W2K and XP have. (Checks on environment variables like 'OS' are not easy, e.g. W2K still shows 'Win_NT' just as NT itself does.) If the needed files are not there, jump to a part of the batchfile which has a thirdparty or free util that forces a reboot. In itself, at the end of a batchfile the user will always be IN the network and that's not what you want...

HTH,

- The Netherlands

by syscokid

@echo off
ver |find "XP">nul
if errorlevel 1 goto notXP
:: XP stuff here
...
goto end

:notXP
ver |find "98">nul
if errorlevel 1 goto not98
:: 98 stuff here
...
goto end

:not98
(and so on, 95, NT, 2K, whatever - use the string from VER to find an appropriate string to test with FIND)

:end

This discussion is closed to new replies.