Jump to content

lock keyboard + mouse


Recommended Posts

I want to use my unattended installation at a small office. When all the applications are being installed, users can close the windows by clicking on the X in the top right corner, or when certain applications install, click the CANCEL button. I want to prevent this. Is it possible to, at the first logon when the applications install, lock the keyboard and mouse so that users can't interfere in the installation process ? If so, how can this be done, are there some small tools, or can this be done with one or more registry tweaks ? Of course, after the installation completes and the workstation reboots, users should be able to use their mouse and keyboard.

Hope some already have experience with this..

Link to comment
Share on other sites


Thanks for the urls. I checked them all this afternoon, but only the first one (experts-exchange) seems to be relevant. Unfortunately you have to subscribe to view the answer. I don't have the money for that... The other links/appz/tools don't do what I want it to do....

Link to comment
Share on other sites

Use these two exes to block and unblock user input during batch operations.

Ctrl+Alt+Del still works.

:) Somehow I just knew they were going to be compiled AutoIt scripts... :rolleyes:

Link to comment
Share on other sites

You didn't need to pay to see the answer. Only a sign up. But here it is anyway:

You may be able to use the Window API call "BlockInput."  The call interrupts all keyboard and mouse input, although program faults or pressing CTRL-ALT-DELETE can interrupt the call.

Details about the API call can be found at:

http://msdn.microsoft.com/library/default..../BlockInput.asp

BlockInput only works on Windows 98/Me/2000/XP operating systems.  It isn't supported on Windows 95 or NT.

To use the BlockInput call from a VBS script, you can refer to:

http://home.att.net/~geekStuff/wshBlockInputPage.htm

The page above provides a pair of VB-based OCX controls which allow for calling BlockInput().  The page also provides a sample VBS script for invoking the OCX controls.  To use the OCX controls, the computer must have MSVBVM50.DLL installed, and the OCX's must be registered prior to use.

I've also whipped together two other possible methods of calling BlockInput -- a simple executable, Block.exe, that blocks input, and a scriptable component, BlockATL.dll that blocks input.  BlockATL.dll does not require MSVBVM50.DLL but would also have to be registered first.  A sample VBS script is provided in the zip package, which can be found at the address below.

http://www.owlnet.rice.edu/~ryanp/BlockInput.zip

Link to comment
Share on other sites

  • 2 weeks later...

@Krissam

Try this... Go in the park and put a sign "do not tuch freshly painted" on a parkbench and count the persons who will touch the bench. It would surprise me if NO person will touch this bench.

@All

I have tryed the block.Exe (BlockInput.zip) but without the DLL and the exe won´t work. Then I tryed the AutoIt Scripts... but it seamed that the Autoit command will ONLY run in an autoit script... so THE whole unattended batch MUST be in an autoit Script so perhaps this will work. I will not give the block.exe(BlockInput.zip) a new try... and will copy the DLL in the windows Root-Direktory.

Edit/Update:

The Block.exe don´t work... the batch will stop when I start the Programm in the Script via: %systemdrive%\install\block.exe there is no difference if the dll is on the CD or not.

Is there anybody wo have a soulution? Or is there an error I made???

Edited by Bastian_W
Link to comment
Share on other sites

There is an easier way to disable the keyboard and mouse. All you have to do is disable the kbdclass and mouclass services in the registry. Here is the code I use to do that

REM Disable Keyboard and MouseSET SERVICES=HKLM\SYSTEM\CurrentControlSet\ServicesREG ADD %SERVICES%\kbdclass /v Start /t REG_DWORD /d 4 /fREG ADD %SERVICES%\mouclass /v Start /t REG_DWORD /d 4 /f

and to reenable them

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExECHO Setup Registry Key to unlock mouse after installs are doneREG ADD %KEY%\996 /VE /D "Unlocking Mouse" /fREG ADD %KEY%\996 /V 1 /D "REG ADD HKLM\SYSTEM\CurrentControlSet\Services\mouclass /v Start /t REG_DWORD /d 1 /f" /f
ECHO Setup Registry Key to unlock keyboard after software installs are doneREG ADD %KEY%\997 /VE /D "Unlocking Keyboard" /fREG ADD %KEY%\997 /V 1 /D "REG ADD HKLM\SYSTEM\CurrentControlSet\Services\kbdclass /v Start /t REG_DWORD /d 1 /f" /f
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...