JSI Tip 4215. How do I hide the logon script window on 'all' clients?


If you have a mix of Windows NT clients (Windows NT, Windows 2000, and Windows XP), tip 0438 can be used to hide the logon script window.

Using Workstation.bat, I have scripted HideLogonWindow.bat to automate the process. The usage syntax is:

HideLogonWindow Domain Account Password LogonScript PDC \[DC1 DC2 ... DCn\]

where:

    Domain          See Workstation.bat   
    Account          See Workstation.bat   
    Password          See Workstation.bat   
    LogonScript          The logon script name, such as logon.bat.   
    PDC          The Computer Name of the PDC.   
    DC(s)          A list of additional domain controller names.   

HideLogonWindow.bat logs it's activity at \\PDC\NETLOGON\hidelogon.log.

HideLogonWindow.bat contains:

@echo off
setlocal
If \{%5\} EQU \{\} goto syntax
set domain=%1
set account=%2
set pw=%3
set logon=%4
set logon=%logon:"=%
set wrk=%5
set wrk=\\%wrk:"=%\[email protected] REGEDIT4>%wrk%hidelogon.reg
@echo.>>%wrk%hidelogon.reg
shift
shift
shift
:loop
shift
if \{%1\} EQU \{\} goto apply
set srv=%1
set srv=%srv:"=%
set script="\\%srv%\NETLOGON\%logon%"
if NOT exist %script% goto syntax
@echo \[HKEY_CURRENT_USER\Console\__%srv%_NETLOGON_%logon%\]>>%wrk%hidelogon.reg
@echo "QuickEdit"=dword:00000800>>%wrk%hidelogon.reg
@echo "WindowSize"=dword:0005000d>>%wrk%hidelogon.reg
@echo "WindowPosition"=dword:3fc0000>>%wrk%hidelogon.reg
@echo "FontSize"=dword:0014000a>>%wrk%hidelogon.reg
@echo "FontFamily"=dword:00000030>>%wrk%hidelogon.reg
@echo "FontWeight"=dword:00000190>>%wrk%hidelogon.reg
@echo "HistoryNoDup"=dword:00000000>>%wrk%hidelogon.reg
@echo. >>%wrk%hidelogon.reg
@echo. >>%wrk%hidelogon.reg
goto loop
:syntax
@echo HideLogonWindow Domain Account Password logonScript PDC \[DC1 DC2 ... DCn\]
endlocal
goto :EOF
:apply
@echo @echo on>%wrk%hidelogon.bat
@echo if NOT "%OS%"=="Windows_NT" goto :EOF>>%wrk%hidelogon.bat
@echo regedit /s %wrk%hidelogon.reg>>%wrk%hidelogon.bat
@echo.>>%wrk%hidelogon.bat
if exist %wrk%hidelogon.log del /q %wrk%hidelogon.log 
call Workstation %domain% %account% %pw% WS %wrk%hidelogon.bat %wrk%hidelogon.log
@echo Finished applying hidelogon.reg
del /q %wrk%hidelogon.bat
del /q %wrk%hidelogon.reg
endlocal


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