Jump to content
Sign in to follow this  

Determine process launching compiled script?

Recommended Posts


I've got a print driver which launches another app after one selects "Print" from the regular print dialog.

What I'm trying to do is:

  • Redirect the call from the second app and set it to run my compiled autoit .exe (already done this).
  • Have my autoit script then launch the second app (with the $CmdLine variable pass on) that was supposed to be run. I can't do this because somehow the second executable recognizes that it wasn't run in the normal fashion. It produces a window saying "This application cannot be run from the command line."
I can, of course, get the $CmdLine variable with my script so that I can pass it on to the second app - that is easy, but I'm not sure how to replicate the correct launching behavior to trick the second app into running correctly. I'm guessing I need to somehow capture what is actually happening, but am not sure how to do this.

My other option would be to simply create a script that watches for the window of the second app to appear and then do what I want. But, I hate to do this because it just seems messy to have a script idling away looking for a window to appear that may only happen several times a day. I'm also concerned about CPU impact and would like to handle it as I've first described.

Any ideas on determining how the call is actually being made from the first app to the second app (tools?). Or, I'm guessing that if a window watcher script only checks for the window every second, it probably wouldn't impact things too much?

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