Jump to content

Automating Forms Problem, Form Loses Focus When Remote Terminal Minimized

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]

If @error Then
$sMessage = "Problem with prjFixMVD.exe"
$w = WinWaitActive("MVD Fix", "", 5)
If Not $w Then
$sMessage = "Problem with MVD Fix"
Send ("{TAB}")
Send ("{Tab}")
Send ("{Space}")
Edited by t123456
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...