Jump to content

Force application to run again


kiwiIT
 Share

Recommended Posts

Hi Everyone,

Pretty new at this but slowly getting there.

Still in testing and stuck on one piece.

I need to somehow detect when a user has started my exe from START MENU - PROGRAM FILES.

In the Start Menu - Program Files is a shortcut to my exe that lives in the C:\Prog Files

My program has rules when it can and cannot run, and that logic is based around a file that contains a subnet address and a DR situation.

BUT - I need to force the application to run if the user has manually launched from the Start menu/Program Files list.

Any Ideas - stuck.

Cheers for any help.

NZ - over and out

Link to comment
Share on other sites

Deny any other way so they have no choice would the the simplest approach.

Once a program is running there is no simple way to tell how it was executed. The shortcut calls the exe which invokes the program, all windows knows is the program has been started.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

The only thing I can think of is attaching a command line parameter to the Start Menu shortcut. As long as the user does not remove the parameter from the shortcut, it will always be there when the application is started from that specific shortcut, and you can check for it in the script.

Thanks Thanubis.

Your idea works and I am going with that.

Cheers for the info.

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