I have scripted TBLocked.bat to determine if the Internet Explorer 7 Toolbars are locked.

The syntax for using TBLocked.bat is:

\[call\] TBLocked Status

Where <b>Status</b> is a <a href="/article/tips/tip.aspx?id=5535">call directed environment variable</a> that will contain:

                <b>L</b> - If the Toolbars are locked.
                <b>U</b> - If the Toolbars are unlocked.
                <b>X</b> - If the status is unknown, an error condition.
TBLocked.bat contains:
@echo off
if \{%1\}==\{\} @echo Syntax: TBLocked Status&goto :EOF
set key="HKCU\Software\Microsoft\Internet Explorer\Toolbar"
set Status=X
for /f "Tokens=3" %%a in ('reg query %key% /V Locked^|find "REG_DWORD"') do (
 if "%%a" EQU "0x0" set Status=U
 if "%%a" EQU "0x1" set Status=L
endlocal&set %1=%Status%
NOTE: See tip 11075 ยป How can a script lock the Internet Explorer 7 Toolbars?