Jump to content

How to detect if the script is running at startup


Recommended Posts

when you place it in the startup routine, use a parameter like myexe.exe -param

So if it was started through startup it would have that param there, if started manually by user then it would not be called with any parameters

EDIT: Something like that?

Edited by danwilli
Link to comment
Share on other sites

We could help more if you were more specific in asking. The command line parameter will work just fine, as suggested.

Have the startup entry say "script.exe -onstartup" and check for -onstartup. If it isn't there, then it wasn't run from the startup entry. There is no Window's defined way to see if it started at startup or by the user.

Well actually, I guess you could check the login time and the process starting time. If they are close enough together you can probably assume the script was run at startup. Dunno how to do so, but I know it is possible.

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