@echo off if "%1"=="" goto :SYNTAX goto :%1 :UN :OFF :DISABLE regedit /s y:\ntload\reg\undns.reg echo DNS disabled>C:\WINNT\FLAGS\DNSOFF.FLG goto :EXIT :ENABLE :RE :ON regedit /s y:\ntload\reg\dns.reg if EXIST C:\WINNT\FLAGS\DNSOFF.FLG del C:\WINNT\FLAGS\DNSOFF.FLG goto :EXIT :CHECK set DNS=ON if NOT exist C:\WINNT\FLAGS\DNSOFF.FLG if EXIST H:\NETSTORE\UNDNS.FLG set DNS=OFF if NOT exist C:\WINNT\FLAGS\DNSOFF.FLG if EXIST C:\WINNT\UNDNS.FLG set DNS=OFF if EXIST C:\WINNT\FLAGS\DNSOFF.FLG if "%DNS%"=="ON" goto :ON if "%DNS%"=="OFF" goto :OFF goto :EXIT :FLAG if "%2"=="" goto :SYNTAX goto :%2 :W :WS :WORKSTATION if NOT "%3"=="" goto :DELWS echo DNS Disabled for Workstation>C:\WINNT\UNDNS.FLG winmsg 3 "DNS disabled for this workstation" goto :CHECK :DELWS del C:\WINNT\UNDNS.FLG winmsg 3 "DNS enabled for this workstation" goto :CHECK :U :USER if "%4"=="" goto :SYNTAX set SRVR="CC" for %%A in (PW pw FD fd) do if "%%A"=="%4" set SRVR=%4 if NOT "%5"=="" goto :DELUSER echo DNS Disabled for %3>\\vop%srvr%\data\depts\%4\users\%3\netstore\UNDNS.FLG winmsg 3 "DNS disabled for %3 in %4" goto :CHECK :DELUSER del \\vop%srvr%\data\depts\%4\users\%3\netstore\UNDNS.FLG winmsg 3 "DNS enable for this user" goto :CHECK :SYNTAX echo. echo DNS - Enables/Disables DNS echo. echo SYNTAX: echo. echo DNS (ENABLE/DISABLE/CHECK/FLAG) (WS/USER) (USERNAME) (DEPT) (ON/OFF) echo. echo ENABLE: Enable DNS echo DISABLE: Disable DNS echo. echo CHECK: Checks WS and User for DNS access, and whether currently echo enabled or not, and set accordingly echo. echo FLAG: (WS/USER) (USERNAME) (DEPT) (DELETE) echo specify Workstation or User to disable DNS access echo if USER is specified, specify UserName and Dept as well echo. echo NOTE: by default, the flag to DISABLE access is created echo. echo DELETE as last parameter will remove the disable flag echo. echo To re-enable access, you must manually delete the flag file echo. pause :EXIT set DNS= set SRVR= set USR=