Sign in to follow this  
Followers 0
Kreatorul

How to detect if the script is running at startup

10 posts in this topic

How can I see when the script is ran at startup(meaning for the first time) not if it has a shortcut in the startup dir. 10x

Share this post


Link to post
Share on other sites



That would only work for one time when I start the script for the first time, I want to check if when the script is first run, that first time is at startup or not.

Share this post


Link to post
Share on other sites

Make a log somewhere, file/registry/whatever. The next time you run the script, that log with exist, so you know it won't be the first time.

Share this post


Link to post
Share on other sites

You didn't get it. I want the program to minimize when started but only if it was started from the startup. making a log would tell me it's not the first time but I can't know if it's ran at startup or not...

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

I still have to detect whether is started with startup or not...there is no startup routine except puttin' the shortcut in the startup dir and that doesn't help. 10x for tryin'

Share this post


Link to post
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.

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  
Followers 0