Sign in to follow this  
Followers 0
sharathpoluru

Run AutoIT script remotely

10 posts in this topic

#1 ·  Posted (edited)

Hello All:

I am working on a below Proof of Concept/Activity:

- Connect to workstation/machine via RDP (i.e. Remotely)

- Invoke Acrobat Reader in remote machine

- Close the reader after it is invoked

Tried performing above steps using RUNAS command. However, I was unable to connect to machine remotely.

Can someone please share some insight?. Any assistance is highly appreciated.

Thanks ..

Regards,

Sharath

Edited by sharathpoluru

Share this post


Link to post
Share on other sites



hello sharathpoluru, welcome to Autoit and to the forum!

after you connect to RDP, if you need to open/close apps and do other stuff with AutoIt, you must copy the AutoIt script (compiled, obviously) to the remote workstation and launch it insied the RDP session. a script running on your workstation will not interact with windows running inside the RDP session.

other than that, your description is quite vague. what exactly is not working? RunAs has nothing to do with what you are trying to accomplish, so what exactly did you try? what error messages do you get?

Share this post


Link to post
Share on other sites

hello sharathpoluru, welcome to Autoit and to the forum!

after you connect to RDP, if you need to open/close apps and do other stuff with AutoIt, you must copy the AutoIt script (compiled, obviously) to the remote workstation and launch it insied the RDP session. a script running on your workstation will not interact with windows running inside the RDP session.

other than that, your description is quite vague. what exactly is not working? RunAs has nothing to do with what you are trying to accomplish, so what exactly did you try? what error messages do you get?

 

Thank you for sharing some insight.

Let me elaborate the problem statement.

I am trying to invoke some applications installed on 1000 machines on a domain via RDP. For instance, Acrobat Reader is one such application installed in 1000 machines on a domain wherein I am trying to invoke arcobat reader on each machine via RDP (i.e. remotely) and close it. This ensures my requirement is met.

Having said that, I am checking the feasibility to automate above task.

Please let me know, if we can achieve above task using AutoIT.

Thanks.

Note:

As part of analysis, I have identified RunAs function where it can invoke .exe from selected location via RDP

RunAs ( "username", "domain", "password", logon_flag, "program" [, "workingdir" [, show_flag [, opt_flag]]] )

Share this post


Link to post
Share on other sites

yes you can. but first, do you need to do something that requires desktop interaction, or psexec will do?

Share this post


Link to post
Share on other sites

yes you can. but first, do you need to do something that requires desktop interaction, or psexec will do?

Yes. Psexec will do ..

Share this post


Link to post
Share on other sites

cool. just remember that psexec launches it's process in the background with the local system account, so you can't interact with open windows and applications. best of luck!

Share this post


Link to post
Share on other sites

cool. just remember that psexec launches it's process in the background with the local system account, so you can't interact with open windows and applications. best of luck!

Thanks.

However, there is a pointer here. I am trying to invoke some 'Proprietary Application' (i.e. Home grown applications) wherein we see a shortcut only on desktop (i.e. Home grown application with NO .exe or .bat and so on in C: drive. We see only a shortcut of home grown application on desktop)

Hence, do we have a way to invoke the relevant shortcut of these home grown application?.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

find which exe is launched by the shortcut:

by external program:

http://www.nirsoft.net/utils/shman.html

by AutoIt script:

'?do=embed' frameborder='0' data-embedContent>>

the hard way:

launch it and see which exe is added to the processes list in Task Manager.

EDIT: for "home grown" application, you do a really good job if you can't get the exe from the shortcut  ;)

Edited by orbs

Share this post


Link to post
Share on other sites

find which exe is launched by the shortcut:

by external program:

http://www.nirsoft.net/utils/shman.html

by AutoIt script:

'?do=embed' frameborder='0' data-embedContent>>

the hard way:

launch it and see which exe is added to the processes list in Task Manager.

EDIT: for "home grown" application, you do a really good job if you can't get the exe from the shortcut  ;)

 

Thank you for prompt response.

Let me go back and validate to see, if my requirement is achieved.

Will keep you posted with latest updates.

Thanks ..

Regards,

Sharath

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

You could always make a AutoIt script that checks a web server page for instructions. Then, Install such script on your domain computers and, Set it to autorun on boot/login. Build a check to pause the script if $NewMessage = $OldMessage. That way you could launch AdobeReader on 1000 computers simultaneously. Though, The ethics of such script may be questionable. It seems in your situation it would solve your issue in the simplest of ways. Which would free up a lot of your time and, resources. 

Edited by BlackDawn187

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  
Followers 0