# Autohotkey when station locked

I'd like to be able to use hotkeys to run scripts when the screen is locked.

I have:

^!p::Run, D:\path\to\my\script.bat


But if the computer is locked it won't run.

I'm running Win7 64.

-

## migrated from stackoverflow.comJun 9 '13 at 12:12

This question came from our site for professional and enthusiast programmers.

As far as I know, this is a protection method from Windows, nothing AutoHotKey can do about it. Otherwise, you could run a login script while Windows is locked. –  Robert Ilbrink Jun 9 '13 at 9:24
So there's no way I can run my script when it's locked? –  pocpoc47 Jun 9 '13 at 10:07
No, you might want to take a look at task scheduler. –  user197261 Jun 9 '13 at 11:24
But task scheduler run it at certain times, not when I want to –  pocpoc47 Jun 9 '13 at 12:44
Not a solution, but the best thing I could offer is to replace Windows' Ease of access functionality with cmd.exe. You can then communicate with your script via command line, e.g. with start parameters, without having to log in. –  MCL Jun 12 '13 at 18:46