Jump to content

Run autoit in disconnected (but logged in) remote desktop session in WinXP


noobie1
 Share

Recommended Posts

Hi,

I am trying to figure out a way to run a couple autoit scripts on a remote WinXP SP3 machine which is logged into but disconnected. The problem is that the autoit script automates a GUI based app and if I disconnect the user (not log off), the script just halts there and doesnt do anything. Once I re-logon, it picks up from where it left off.

I have disabled output suppression with the HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client!RemoteDesktop_SuppressWhenMinimized set to 2. The script works like a charm as long as I have the user logged in and the RDC window is minimized, however, if I close the RDC window, the script halts...

Running this on a Win Server environment is not an option as the app that I am trying to automate doesn't run on Server platforms..

Any help would be very much appreciated..

THanks

Link to comment
Share on other sites

Sounds very much like the problems encountered when trying to run a script on a locked workstation. Are you using Send or ControlSend? See the Wiki for an explanation.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

If you are not using Send or control send as BrewManNH suggested you could try Running the exe as a service.

Also if the program is dependent on another program the issue may be that that program is halting.

You can also look into Multi RDP connections.

First thing on google i found.

http://www.mydigitallife.info/enable-multiple-concurrent-remote-desktop-connections-or-sessions-in-windows-xp/

Hope this helps.

Link to comment
Share on other sites

"Multi RDP connections"

That's what I do. I have three different XP machines running AutoIt3 scripts interacting with the front end of the same program. I have a third XP machine (oldie) that runs a RDP of all three machines running scripts ... I call it my RDP monitor machine.

As an aside, I have one of those XP machines providing two RDP sessions for the RDP monitor because I want two active scripts running on two separate programs.

I wish XP provided the ability to run separate desktop instances on the same machine. I tried using virtual desktops (like Dexpot) but the windows the script was watching for kept coming to the main desktop and interrupted the activity on the main desktop.

Link to comment
Share on other sites

Thanks for the suggestions.

Kendall, Iam indeed using send() heavily to send keystrokes to the GUI, so i guess windows service wont work.

OregonJohn, a multiRDP probably wont work as it's essentially a hack and our IT dept may have some heartburn with that.

Link to comment
Share on other sites

Sounds very much like the problems encountered when trying to run a script on a locked workstation. Are you using Send or ControlSend? See the Wiki for an explanation.

Sounds very much like the problems encountered when trying to run a script on a locked workstation. Are you using Send or ControlSend? See the Wiki for an explanation.

BrewManNH,

Does controlsend() work with apps that have ribbons? Iam having difficulty doing that...

Link to comment
Share on other sites

Yes, ControlSend() operation works file for this problem...

ControlSend("title","text","","field1")

ControlSend("title","text","","{TAB}")

ControlSend("title","text","","field2")

ControlSend("title","text","","{TAB}")

ControlSend("title","text","","field3")

ControlSend("title","text","","{ENTER}")

Link to comment
Share on other sites

Yes, ControlSend() operation works file for this problem...

ControlSend("title","text","","field1")

ControlSend("title","text","","{TAB}")

ControlSend("title","text","","field2")

ControlSend("title","text","","{TAB}")

ControlSend("title","text","","field3")

ControlSend("title","text","","{ENTER}")

Venugopalpoli,

Not sure what the {TAB}s do but i tried the following code on excel and it results in the attached output... (it's supposed to close the excel window but basically does nothing)

ControlSend("Microsoft Excel", "","[CLASS:NetUIHWND; INSTANCE:2]","!fc")

post-75229-0-27495800-1347403039_thumb.j

Edited by noobie1
Link to comment
Share on other sites

If you're automating Excel, use the Excel UDF, it's much much simpler.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

If you're automating Excel, use the Excel UDF, it's much much simpler.

Was just using it as an example, i have a third party .net based app that i need to automate. The point being that the code is not working for .net apps (which have ribbons etc).

The UDF that you referred to may be for COM objects only..

Link to comment
Share on other sites

  • 2 weeks later...

I have been trying to run some autoit scripts on a disconnected (but, logged in) RDP session with little success. The scripts that run well have no gui at all (CUI) and only interact with other programs using the STDIO stream. I will be experimenting with some options this weekend.

specs:

2 servers running 2003 server.

each runs several instances of a program with incrimented window handles(GUI) (must be controlled by autoit)

one of the servers is a web server (both servers need to access this to run web scripts to process data for the program instances)

a third server acts as a MySQL server holding most of the relevant data.

the directory holding CUI compiled autoit scripts on the web server has windows user security added as well as a web log in check.

I need to run a script on server 1 that loads protected web pages without any gui, waits for each page to finish, then operates the multi-instance program(s) and alters them accordingly. all without opening the RDP.

I have a lot of work ahead of me and this seamed like the perfect thread to tack on my findings. (and maybe get some help myself)

p.s. so far, i am not sending any keystrokes or mouse clicks. I am pushing a button through the stdio and using guictrlsetdata to send a filename to a file select window.

Link to comment
Share on other sites

i have , so far , had greater success than i anticipated. As long as i refrain from using commands that emulate physical input methods and graphic manipulation, all is well with controlling my running programs.

Now i will be testing the use of secure web pages.

not sure if i should try the ie.au3 without showing the page ... or if i should go with raw http requests.

most of the pages i need to run contain several scripts and end with a "process finished successfully", 'process failed...", or just a plain"DONE".

some of these pages contain multiple iframes that work with each other until thier task is complete.

hopefully i'll post more soon.

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...