JackLiu Posted December 15, 2010 Share Posted December 15, 2010 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 : //begin $kcxpPath = IniRead(GetConfigFile(),"KCXP","kcxpPath","") $kcxpProgram = IniRead(GetConfigFile(),"KCXP","kcxpProgram","") $kcxpWinTitle = IniRead(GetConfigFile(),"KCXP","kcxpWinTitle","") $flag = -1 If ChkService($kcxpProcess) = 0 Then Run($kcxpProgram,$kcxpPath) $flag =1 Else If ChkProgram($kcxpWinTitle)=0 Then Run($kcxpProgram,$kcxpPath) $flag =0 EndIf EndIf WinWait($kcxpWinTitle,"",$WaitWinTime) WinActivate($kcxpWinTitle,"") $kcxpWinTitle = WinGetTitle("[active]") If $flag = 1 Then Sleep(1000) ControlCommand($kcxpWinTitle,"",$kcxpWinToolbar, "SendCommandID" , $kcxpStartBtnId) Sleep(6000) $tmpWin = WinGetTitle("[active]") EndIf //end Link to comment Share on other sites More sharing options...
Syed23 Posted December 15, 2010 Share Posted December 15, 2010 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 WinActivate("","") 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] Link to comment Share on other sites More sharing options...
Zedna Posted December 15, 2010 Share Posted December 15, 2010 http://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3F Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now