pocolo Posted September 12, 2011 Share Posted September 12, 2011 (edited) (iam not good at EN)I try write a small script , and put it on my VPS Windows- If i login VPS -> it works:- After logoff and try login again -> not work ( not control ? )Pls help .... $x = 0 While $x < 10 Test() $x = $x+ 1 Sleep(10000) WEnd Func Test() If ProcessExists("winrar.exe") Then ProcessClose("winrar.exe") $WinRarDir = @ProgramFilesDir &"\WinRAR\WinRAR.exe" Run($WinRarDir) Sleep(2000) $title = "Compressed - WinRAR" ConsoleWrite("-Open Compressed WinRAR") WinWaitActive($title) WinActive($title) If WinActive($title) Then ControlFocus( $title, "", "[CLASS:SysListView32; INSTANCE:1]") $hwnd = ControlGetHandle( $title, "", "[CLASS:SysListView32; INSTANCE:1]") $index = _GUICtrlListView_FindText($hwnd,"zip") _GUICtrlListView_SetItemSelected($hwnd, $index) _GUICtrlListView_SetItemSelected($hwnd, $index) ;....... ;...... EndIf EndFunc Edited September 12, 2011 by pocolo Link to comment Share on other sites More sharing options...
JohnOne Posted September 12, 2011 Share Posted September 12, 2011 Because it will never be the active window, sice your login screen is. I think. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
pocolo Posted September 12, 2011 Author Share Posted September 12, 2011 don't have solution? Link to comment Share on other sites More sharing options...
JohnOne Posted September 12, 2011 Share Posted September 12, 2011 I'm sure I've seen methods you can try, they sometimes work and sometimes do not as I recall. It was something like this. $PID =Run($WinRarDir) Get the window handle from PID, and get shut of if WinActive($handle) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
pocolo Posted September 13, 2011 Author Share Posted September 13, 2011 I'm sure I've seen methods you can try, they sometimes work and sometimes do not as I recall. It was something like this. $PID =Run($WinRarDir) Get the window handle from PID, and get shut of if WinActive($handle) No control to work Link to comment Share on other sites More sharing options...
Zedna Posted September 13, 2011 Share Posted September 13, 2011 Look here 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...
pocolo Posted September 14, 2011 Author Share Posted September 14, 2011 Look herehttp://www.autoitscript.com/wiki/FAQ#Why...y_script_work_on_a_locked_work thanks 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