Jump to content

Automating Forms Problem, Form Loses Focus When Remote Terminal Minimized


t123456
 Share

Recommended Posts

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 by t123456
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...