Smitro Posted May 10, 2009 Share Posted May 10, 2009 (edited) Is it possible to either get a session ID or generate one for Windows Login? I've got an app that runs at start up. I then want to check later if this has been run durring this logon session. For example, if the user logs off and back on or turns off the computer, I need to know that its a different session to the first. Is there anyway to do this? Or, next option, set a variable at the start of a session, and then later check to see if that variable has been set, but the variable would have to be killed before next login. Edited May 12, 2009 by Smitro Link to comment Share on other sites More sharing options...
JackDinn Posted May 11, 2009 Share Posted May 11, 2009 (edited) would you not just right a log file at the program starting so you would generate a log containing a list of time and date each time your app was run. maybe even add user to the log as well #include <file.au3> _FileWriteLog (@ScriptDir & "\App_Launch_logs.txt", @UserName) Edited May 11, 2009 by JackDinn Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D Link to comment Share on other sites More sharing options...
Smitro Posted May 12, 2009 Author Share Posted May 12, 2009 Ok, I'll have to give away more info We're having trouble with our login scripts not fireing off on startup. Most times they do, but in some cases they don't for some unknown reason. What I'd like to do is run something that checks if the script has run and if not run it. I think what I might do is use something like a text file to state when the last login was and if the login script has updated the file in the last 2 mins if not, run it. It might be the simplest way, rather than checking to see if a variable was set on login. Thanks for your help. Link to comment Share on other sites More sharing options...
JackDinn Posted May 12, 2009 Share Posted May 12, 2009 well still a little confused as to what your after but if you could solve the reason why your scripts are not always running at win logon then it might be the best solution. how exactly are you running the .exe (I assume) on logon? are there a lot of other processes/services being run at logon? can you put your finger on what circumstances might be causing this problem to occur? i.e only on some systems or at certain times of the day or particular user accounts etc.. try something like "HijackThis" to have a good look at whats going on at startup. the problem with trying to write a script that checks for this failure is that whatever script you do will it's self need to be run at startup (or maybe with the scheduled tasks might be an option if all else fails) and your back to the same problem so i would try to figure out y it is not running at logon before anything else. Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D 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