Hi,
I am trying to run a program (batch file) located on a w2K server.
The script I have written needs to open the sever as a citrix session and then run the program in the citrix.
Trying to use "run program" or "execute" runs the program on the local machine not in the citrix session. I have set focus onto the citrix window but still cannot get the program to run on the session.
Any ideas much appreciated.
Chers
Chris
Run a program in citrix window
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
If Macro Scheduler is running on YOUR machine then "Run Program" will run the program/command/batch file on YOUR machine. If you want it to do something inside a remote session then either it needs to be installed INSIDE the remote session, or you need to automate the session - simulate user input, using it as you would.
E.g. if you wanted to run a command line on the remote session would you click Start/Run on YOUR machine and issue a command, or click on a desktop shortcut on YOUR desktop? No - of course not - that would only have an effect on YOUR desktop. No, you'd click Start/Run or double click the desktop shortcut INSIDE the citrix session.
Setting focus simply sets the keyboard focus. It won't make Run Program know about the remote operating system. Here's how citrix/remote desktop/VNC/Radmin/PC Anywhere/etc/etc work:
1. An image of the remote environment is transmitted across the network and displayed on your screen inside a window.
2. When you move the mouse or press a key inside that window the mouse/keyboard event is detected, a message is sent to the server and the mouse/keyboard event simulated there.
In short we have a copy of the screen and we can send it mouse and keyboard events. That's it.
If you want to automate a remote session you will have to do so by sending mouse/keyboard events to it. You can detect objects using image recognition because you can SEE the remote environment.
But Run Program runs apps on the local machine. All script commands work on the LOCAL machine. The only way to have them work on the remote machine is to have Macro Scheduler installed ON IT.
E.g. if you wanted to run a command line on the remote session would you click Start/Run on YOUR machine and issue a command, or click on a desktop shortcut on YOUR desktop? No - of course not - that would only have an effect on YOUR desktop. No, you'd click Start/Run or double click the desktop shortcut INSIDE the citrix session.
Setting focus simply sets the keyboard focus. It won't make Run Program know about the remote operating system. Here's how citrix/remote desktop/VNC/Radmin/PC Anywhere/etc/etc work:
1. An image of the remote environment is transmitted across the network and displayed on your screen inside a window.
2. When you move the mouse or press a key inside that window the mouse/keyboard event is detected, a message is sent to the server and the mouse/keyboard event simulated there.
In short we have a copy of the screen and we can send it mouse and keyboard events. That's it.
If you want to automate a remote session you will have to do so by sending mouse/keyboard events to it. You can detect objects using image recognition because you can SEE the remote environment.
But Run Program runs apps on the local machine. All script commands work on the LOCAL machine. The only way to have them work on the remote machine is to have Macro Scheduler installed ON IT.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
This article demonstrates a way to automate a Citrix session reliably:
http://www.mjtnet.com/blog/2007/02/20/h ... cognition/
http://www.mjtnet.com/blog/2007/02/20/h ... cognition/
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- AntoniusMomac
- Junior Coder
- Posts: 20
- Joined: Fri Dec 07, 2007 7:46 am
- Location: New York City, NY
The only way to have them work on the remote machine is to have Macro Scheduler installed ON IT.
So if you had a script which was developed on a local machine using commands such as WaitWindow, MouseOver or SetFocus; You would need to have MS loaded on the Citrix server and launch the script from the server. Is that correct?
Love Simple!! "Simplicity means the achievement of maximum effect with minimum means" - Dr. Koichi Kawana, Architect, designed the botanical gardens
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Yes, if those commands want to act against the windows INSIDE the Citrix session. If they are acting on the local Citrix client window then they could run locally. But I'm guessing you want the former.AntoniusMomac wrote:So if you had a script which was developed on a local machine using commands such as WaitWindow, MouseOver or SetFocus; You would need to have MS loaded on the Citrix server and launch the script from the server. Is that correct?
Remember:
Code: Select all
********** Screen Images ***********
YOUR PC <------------------------ Citrix
Runs Citrix Session
Client ------------------------->
Key/Mouse Events
********** ***********
All we know about is screen pictures.
We don't know about window titles, objects, operating system functions. For all we care the remote operating system could be Linux.
So Macro Scheduler running on your PC cannot know about objects and other items inside the Citrix session except in terms of images. Hence Screen Image Recognition being so useful for automating remote environments. But if you want to know about the detail of processes inside the remote environment you need to BE inside the remote environment.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?