JSI Tip 8324. How do I set the 'Internet Options / Advanced / Disable Script Debugging (...)' option in a script?
August 2, 2004
The Disable Script Debugging (...) options are NOT exposed in any Group Policy. I have scripted DSD.bat to set the option(s) into a logged on user's HKEY_CURRENT_USER hive.
The syntax for using DSD.bat is:
[call] DSD [/I:Y|N] [/O:Y|N] [/B:Y|N]
Where /I:Y|N is an optional switch that disables the script debugger (Y), or enables it (N).
In the future (Windows XP SP2), Windows will support Disable Script Debugging (Internet Explorer) and Disable Script Debugging (Other). When both options exist, the /O:Y|N switch will set the Disable Script Debugging (Other) value into the registry. The /B:Y|N switch will set both options.
NOTE: Currently, only the Disable Script Debugger Value Name exists in the registry. In Windows XP SP2, the DisableScriptDebuggerIE Value Name will be added. For compatibility, the [/I:Y|N] switch will set the Disable Script Debugger Value Name if the DisableScriptDebuggerIE Value Name does not exist.
DSD.bat contains:
@echo offsetlocalIf not {%3}
{} goto err1if {%1}
{} goto err2:loopif exist "%TEMP%DSD.reg" del /q "%TEMP%DSD.reg"if {%1}=={} goto finishset switch=%1shiftif /i "%switch:~3,1%" EQU "Y" goto :OKif /i "%switch:~3,1%" NEQ "N" goto :err2:OKif /i "%switch:~0,3%" EQU "/I:" goto IEif /i "%switch:~0,3%" EQU "/O:" goto Otherif /i "%switch:~0,3%" EQU "/B:" goto Bothgoto err2:IEset DSDIE=Nregedit /a "%TEMP%DSD.reg" "HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMain"for /f "Tokens=*" %%a in ('findstr /I /L /C:"DisableScriptDebuggerIE" "%TEMP%DSD.reg"') do ( set DSDIE=Y)del /q "%TEMP%DSD.reg"if "%DSDIE%" EQU "N" goto :Othercall :outkey@echo "DisableScriptDebuggerIE"="%DYN%">>"%TEMP%DSD.reg"goto setvalue:Othercall :outkey@echo "Disable Script Debugger"="%DYN%">>"%TEMP%DSD.reg"goto setvalue:Bothcall :outkey@echo "Disable Script Debugger"="%DYN%">>"%TEMP%DSD.reg"@echo "DisableScriptDebuggerIE"="%DYN%">>"%TEMP%DSD.reg"goto setvalue:outkeyset DYN=noif /i "%switch:~3,1%" EQU "Y" set DYN=yes( @echo REGEDIT4 @echo @echo [HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMain]) >"%TEMP%DSD.reg"goto :EOF:setvalueregedit /s "%TEMP%DSD.reg" del /q "%TEMP%DSD.reg"goto :loop:err1@echo Syntax: [call] DSD [/I:Y^|N] [/O:Y^|N] [/B:Y^|N] - Too many switches.goto :finish:err2@echo Syntax: [call] DSD [/I:Y^|N] [/O:Y^|N] [/B:Y^|N]:finishendlocal
About the Author
You May Also Like