Skip navigation

Q. How can a script determine if the Internet Explorer 7 Toolbars are locked?

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 Status is a call directed environment variable that will contain:

                L - If the Toolbars are locked.
                U - If the Toolbars are unlocked.
                X - If the status is unknown, an error condition.
TBLocked.bat contains:
@echo off
if \{%1\}==\{\} @echo Syntax: TBLocked Status&goto :EOF
setlocal
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?


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