Another way to block user input for n seconds.

In tip 9554 we disabled mouse and keyboard input for n seconds.

I have scripted Theater.bat to open a full screen theater mode Internet Explorer window, effectively blocking input, for n seconds.

The syntax for using Theater.bat is:

Theater Seconds Message


Seconds is the number of seconds that you want the window open.

Message is the text that you want to display in the window.
Theater.bat contains:
@echo off
if \{%2\}==\{\} @echo Syntax: Theater Seconds Message&goto :EOF
@echo %1|findStr "\[^0-9\]">nul
if %ERRORLEVEL% NEQ 1 @echo Syntax: Theater Seconds Message&goto :EOF
if exist "%TEMP%\Theater.vbs" goto doit
@echo.Dim oShell>"%TEMP%\Theater.vbs"
@echo.Set oShell = WScript.CreateObject ("")>>"%TEMP%\Theater.vbs"
@echo.Dim objIE, objDoc, objArgs>>"%TEMP%\Theater.vbs"
@echo.Dim strHTML>>"%TEMP%\Theater.vbs"
@echo.Set objArgs = WScript.Arguments>>"%TEMP%\Theater.vbs"
@echo.sec = objArgs(0)>>"%TEMP%\Theater.vbs"
@echo.msg = objArgs(1)>>"%TEMP%\Theater.vbs"
@echo.Set objIE = CreateObject("InternetExplorer.Application")>>"%TEMP%\Theater.vbs"
@echo.objIE.FullScreen = 1 >>"%TEMP%\Theater.vbs"
@echo.objIE.TheaterMode = 1 >>"%TEMP%\Theater.vbs"                   
@echo.objIE.ToolBar = 0 >>"%TEMP%\Theater.vbs"
@echo.objIE.StatusBar = 0 >>"%TEMP%\Theater.vbs"
@echo.objIE.AddressBar = 0 >>"%TEMP%\Theater.vbs"
@echo.objIE.MenuBar = 0 >>"%TEMP%\Theater.vbs"
@echo.objIE.Resizable = 0 >>"%TEMP%\Theater.vbs"
@echo.Set objDoc = objIE.Document.Body >>"%TEMP%\Theater.vbs"
@echo.strHTML = "<BODY><P><CENTER>" ^& msg ^& "</CENTER></BODY>">>"%TEMP%\Theater.vbs"
@echo.objDoc.InnerHTML = strHTML >>"%TEMP%\Theater.vbs"
@echo.objIE.Visible = True >>"%TEMP%\Theater.vbs"
@echo.Wscript.Sleep sec >>"%TEMP%\Theater.vbs"
@echo.objIE.Visible = False >>"%TEMP%\Theater.vbs"
@echo.objIE.Quit >>"%TEMP%\Theater.vbs"
cscript //nologo "%TEMP%\Theater.vbs" %1000 %2

Hide 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.