kiwiIT Posted January 28, 2010 Share Posted January 28, 2010 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 More sharing options...
bo8ster Posted January 28, 2010 Share Posted January 28, 2010 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 More sharing options...
kiwiIT Posted January 29, 2010 Author Share Posted January 29, 2010 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now