Simple autoit script to toggle Caps Lock on and off in Win7

0

I am looking for a simple autoit script that will toggle the Caps-Lock and/or Num-Lock keys on and off to stop my Windows 7 laptop going to the screensaver and locking.

These options are grayed out due to the new policies that have been rolled out by the employer.

I did try a cursor moving script I found on here, but it did not work and whenever I start using the system, the script seems to pause and I cannot get it to start again without closing the script and relaunching it.

Can anyone help someone with no coding knowledge?

Ally-J

Posted 2015-02-18T09:55:57.513

Reputation: 1

Answers

0

I converted @beatcracker 's Batch code to AutoIt:

Opt("SendCapslockMode", 0)

; Set delay between blinking lights
; Delay = Seconds * 1000
Local $iDelay = 5000

While 1
    Send("{CAPSLOCK on")
    Sleep($iDelay)
    Send("{CAPSLOCK off")
    Sleep($iDelay)
    Send("{NUMLOCK on")
    Sleep($iDelay)
    Send("{NUMLOCK off")
    Sleep($iDelay)
WEnd

If you want to check idle time (to prevent toggling if you're using your machine), take a look on _Timer_GetIdleTime().

Jefrey Sobreira Santos

Posted 2015-02-18T09:55:57.513

Reputation: 111

0

Does it have to be an AutoIt script? If not, CapsLock.exe and NumLock.exe can be wrapped in the simple batch file:

@echo off
:: Set delay beetwen blinking lights
:: Delay = Seconds * 1000

set DELAY=5000
set SLEEP=ping 192.0.2.2 -n 1 -w %DELAY% > NUL

:loop
capslock.exe on
%SLEEP%
capslock.exe off
%SLEEP%
numlock.exe on
%SLEEP%
numlock.exe off
%SLEEP%
goto :loop

beatcracker

Posted 2015-02-18T09:55:57.513

Reputation: 2 334