Jump to content
Sign in to follow this  

Help to resolve the problem of scripts execution while windows screen is locked

Recommended Posts


Hi guys ,

I found Autoit scripts can’t be executed normally after the screen was locked in Windows2003. The keyboard operation , for example “Alt + F” have no response in the condition of locked screen. The left click operation which mimic mouse wasn’t also correctly executed in window, as if the script automatically is stopped when executing the mouse operation by Autoit .

Is it a bug that AutoIt will exceptionally be executed in the situation of locked screen ? If not , please teach me how to write the script , thanks very !

Here referred to my scripts below :


$kcxpPath = IniRead(GetConfigFile(),"KCXP","kcxpPath","")

$kcxpProgram = IniRead(GetConfigFile(),"KCXP","kcxpProgram","")

$kcxpWinTitle = IniRead(GetConfigFile(),"KCXP","kcxpWinTitle","")

$flag = -1

If ChkService($kcxpProcess) = 0 Then


$flag =1


If ChkProgram($kcxpWinTitle)=0 Then


$flag =0





$kcxpWinTitle = WinGetTitle("[active]")

If $flag = 1 Then


ControlCommand($kcxpWinTitle,"",$kcxpWinToolbar, "SendCommandID" , $kcxpStartBtnId)


$tmpWin = WinGetTitle("[active]")



Share this post

Link to post
Share on other sites

Hi ,

I am not sure exactly how the issue was... but if i am not wrong, in particular case your machine got locked due to your script. so you want it to resume back.. correct... i had thi kind of situation where my machine will get locked an i can not be used mouse or keyboar.. to fix this i used below function


All we should do is we should call this function in a correct line where it getting locked... for example... if your machine is getting locked on the below line

"ControlCommand($kcxpWinTitle,"",$kcxpWinToolbar, "SendCommandID" , $kcxpStartBtnId)"

Then you have to add the function WinActivate("","") next to the above line... please correct me if i am wrong!!!

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Share this post

Link to post
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
Sign in to follow this