t123456 0 Posted January 16, 2013 (edited) Hi All, I've got a simple form that I have to put a couple of dates into and click the OK button. I remote into the remote computer using remote desktop connection and run this script and it runs fine. But, if I close the terminal, staying logged in, or just minimize the terminal, the script fails and it get the "Problem with MVD Fix" error. In this case I'm runing it as a scheduled task using a user with admin rights. Far as I can tell, the form MVD Fix is losing focus. I don't know why this is since I'm using winwaitactivate. Looked over the forums but couldn't find the answer. Here is code in question. Local $w, $sContent, $counter, $result Local $aDate = StringSplit(_DateAdd('d', -1, _NowCalcDate()), "/") Local $sDateStart = $aDate[2] & "/" & $aDate[3] & "/" & $aDate[1] $aDate = StringSplit(_NowCalcDate(),"/") Local $sDateEnd = $aDate[2] & "/" & $aDate[3] & "/" & $aDate[1] Run("s:/courtapps/city/prjFixMVDNew/prjFixMVD.exe") If @error Then $sMessage = "Problem with prjFixMVD.exe" ExitLoop EndIf $w = WinWaitActive("MVD Fix", "", 5) If Not $w Then $sMessage = "Problem with MVD Fix" ExitLoop EndIf Sleep(1000) Send($sDateStart) Send ("{TAB}") Send($sDateEnd) Send ("{Tab}") Send ("{Space}") Edited January 16, 2013 by t123456 Share this post Link to post Share on other sites
junkew 397 Posted January 16, 2013 Shows, hides, minimizes, maximizes, or restores a window. WinSetState ( "title", "text", flag ) FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Share this post Link to post Share on other sites
t123456 0 Posted January 16, 2013 I wonder if this is my problem? More or less?http://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3F@Universalist, thanks, I'll give that a shot. Share this post Link to post Share on other sites