Kreatorul Posted October 29, 2007 Posted October 29, 2007 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
xzaz Posted October 29, 2007 Posted October 29, 2007 Regwrite to your registry with a 1 if $regwrite = 1 Then First startup put the 1 in a 0 Else Not the firststartup Endif Small Color Picker v0.2 | Travian bot
Kreatorul Posted October 29, 2007 Author Posted October 29, 2007 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.
Richard Robertson Posted October 29, 2007 Posted October 29, 2007 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.
Kreatorul Posted October 29, 2007 Author Posted October 29, 2007 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...
DW1 Posted October 29, 2007 Posted October 29, 2007 (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 October 29, 2007 by danwilli AutoIt3 Online Help
Kreatorul Posted October 29, 2007 Author Posted October 29, 2007 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'
Joon Posted October 29, 2007 Posted October 29, 2007 Hmm... something like this??? If @ScriptDir = @StartupCommonDir Or @ScriptDir = @StartupDir Then MsgBox(0,'Startup','The program has started from Startup') EndIf If you have shortcut in Startup Dir, you need to pass in parameter.
DW1 Posted October 29, 2007 Posted October 29, 2007 thats what I said LOL, just pass a parameter from the shortcut AutoIt3 Online Help
Richard Robertson Posted October 29, 2007 Posted October 29, 2007 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.
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