I have always had issues with compiled scripts that run in the background. What happens is they take control and render the machine useless for a bit. For instance I have one running now that executes a program every 10 seconds. The program checks for files in a folder and processes them. Since I have started writing this I have had to stop at least 10 times. Before I used to run them as command line programs with cmd /c and it was an issue sometimes now it is a nightmare.
In the past I would change to the directory first and then execute the program with the cmd /c now, I use RunProgram and put the entire path to the compiled script in. I do that because sometimes something would take control and it would not be in the folder to execute the program.
Also, when I execute a compiled script it changes which windows have focus.
This has taken me about minutes to write because I lost focus so much. Is there a switch somewhere so it actually runs in the background.
Compiled Script makes takes control
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Compiled Script makes takes control
Hard to comment out without knowing what your .exe does. If it pops up a UI then clearly it's going to steal focus. Have you tried starting it with the -HIDE parameter?
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?
Re: Compiled Script makes takes control
Only one that I call has a GI. When I run it I use LET>RO_WINDOWMODE=0. I use - HIDE when I compile the Macro. Most of my Macros consist of one that opens a dialog that has a settings, help, run and exit option. The run option triggers a compiles macro that activates command line programs. The program that it calls that gives me the most trouble with stealing focus is MODI (Microsoft Office Document Imaging).