Jump to content
Sign in to follow this  
KNUT265

problems AutoIt running on a remote PC

Recommended Posts

KNUT265

Hello,

since a while we are using AutoIT, it is a very powerfull tool.

Unfortunately there are some errors because AutoIt is acting,

but the PC does not act. The PC is a virtual machine.

Now we are wondering whether it is the PC or AutoIt.

Does anyone has simmilar behaviour?

Regards

Knut

Share this post


Link to post
Share on other sites
JLogan3o13

Hi, KNUT265, welcome to the forum. Can you please provide us with a little more information about what you're trying to accomplish on the VM? Are you trying to launch the AutoIT on the VM from a remote machine? What is the script supposed to do? Are you receiving any errors? How about a snippet of your script? Any additional information you can provide will help us help you. :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
KNUT265

Sorry,

on the VM we have running a CAD-Software.

Sometimes it happens that the software is expecting user input.

AutoIt is supposed to do that.

I have programmed AutoIt in that way, that it creates a report string as often as it does the user input (push OK button, etc.)

Due to that I reconized, that sometimes one action requires 100 clicks.

Now I am wondering whether the 100 clicks are comming from:

* operating system (win7)

* input expecting software (inventor 2010)

* AutoIt

* thus the VM does not have a screen

I am also wondering whether there would be an adaption for the AutoIt.

Regards

Knut

Edited by KNUT265

Share this post


Link to post
Share on other sites
KNUT265

Hello forum,

doesn't someone have a glue for my remote problem?

Regards

Knut

Share this post


Link to post
Share on other sites
JLogan3o13

Hi, KNUT265. As I mentioned before, you need to post your script so we can see what it is doing. Without seeing what you're trying to accomplish, we're just guessing :oops:


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
KNUT265

Sorry, I forgot that.

As said before:

VM with Win7, Software: ACAD mechanical 2010

This script is supposed to close the licence borrowed message.

#include <Date.au3>

; Fenstertitel

Opt("WinTitleMatchMode", 2)

; Datumseintrag in Protokolldatei

$Datum=string(@Year&@Mon&@MDAY)

$file = FileOpen("X:\AutoIt_"&$Datum&".log", 1)

FileWrite($file,_Now() & ", " & @UserName & ", AutoIt - Lizenzinfo - gestartet" & @CRLF)

FileClose($file)

;

;$var = WinList()

;For $i = 1 to $var[0][0]

; Only display visble windows that have a title

;MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1])

;Next

WinWait("Lizenz entliehen")

;$text=WinGetTitle("Lizenz entliehen","Lizenz")

$text="Lizenz entliehen aktiv"

$Datum=string(@Year&@Mon&@MDAY)

$file = FileOpen("X:\AutoIt_"&$Datum&".log", 1)

If $file = -1 Then Exit

;MsgBox(0, "Error", "Unable to open file.")

;AutoIT Eintrag in Protokolldatei

$text="Lizenz Info geschlossen!"

FileWrite($file,_Now() & ", " & @UserName & ", >>" & $text & "<<" & @CRLF)

FileClose($file)

;

WinActivate("Lizenz entliehen")

send("{ENTER}")

Run(@ScriptFullPath)

; Finished!

Due to the log-file I recognized that AutoIt gets the supposed window.

Unfortunately the AutoIt can not close it even it was 100x and more activated.

A delay after send command did not change anything.

Thanks

Knut

Share this post


Link to post
Share on other sites
KNUT265

Hello Folks,

sorry I am still in trouble with my remote problem.

I would appreciate every hint for my problem.

Is it the rdp?

But how could it be rdp, there is only software waiting on a input.

In the meantime I tried also:

* controlsend, no improvement, same behavior

* sleep(xxx), this works sometimes, not in general for all

* winwaitclose, didn't work, run up to timelimit

* winkill, terminated the entire process

Thanks in advance.

Knut

Share this post


Link to post
Share on other sites
Juvigy

So is it a compiled exe you are running on the remote PC from its local drives ? Are you connecting to a VM directly with RDP , or are you connecting to the PC with RDP and then accessing the VM ? You should change all SEND woth ControlSend when possible.

As this is W7 there are often issues with UAC and Administrators. Dont forget to put #RequireAdmin at the beginning of your script.

Share this post


Link to post
Share on other sites
KNUT265

Yes a compiled script is running on the VM.

I connect directly with RDP on the VM; there is no PC it is a server.

As I said above, ControlSend did not made it better, it was absolutly the same behavior as Send.

I assume that it has to do anything with the workload of the VM.

Because when I try to interruped the CAD software it doesn't act

for a long time.

I tried also to change priority of the tasks, but did not change anything.

Also the use of a extended sleep did not solve the problem.

KNUT

Share this post


Link to post
Share on other sites
Juvigy

I would suggest to put every Send action in a separate loop with a sleep 1s inside and a check if the send has worked.

This way it will send - wait 1s for result and of no result - send again until the send is successful.

Share this post


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
Sign in to follow this  

×