Systems By Posted December 27, 2006 Posted December 27, 2006 Hi everyone. I have a quick question. I have a script that runs when a user first starts up their computer. I want to be able to set a timer to run the script again after a defined amount of time just in case the user does not shut down his/hr computer. What would be the easiest way to do this?
xcal Posted December 27, 2006 Posted December 27, 2006 Keep the script open with a while/wend loop, and use TimerInit/TimerDiff. How To Ask Questions The Smart Way
Valuater Posted December 27, 2006 Posted December 27, 2006 maybe... $start = @HOUR & ":" & @MIN + 2 ; for testing While 1 $start2 = @HOUR & ":" & @MIN If $start = $start2 Then Run("notepad.exe") ExitLoop EndIf ToolTip("Start Time = " & $start & @CRLF & "Real Time = " & $start2, 20, 20, "Time Machine", 1) Sleep(2000) WEnd Exit 8)
Systems By Posted December 28, 2006 Author Posted December 28, 2006 Thanks for the tip. It worked. My only issue now is that my application uses 100% of the CPU while the timer is ticking away. Is there something I can do to keep this from happening?
herewasplato Posted December 28, 2006 Posted December 28, 2006 ...my application uses 100% of the CPU...Post your code that causes this - 'cuz the code that Valuater posted should not do that. [size="1"][font="Arial"].[u].[/u][/font][/size]
Systems By Posted December 28, 2006 Author Posted December 28, 2006 Post your code that causes this - 'cuz the code that Valuater posted should not do that.I just figured it out I commented out the sleep after the tooltip. Thanks!
herewasplato Posted December 28, 2006 Posted December 28, 2006 I just figured it out I commented out the sleep after the tooltip. Thanks!The CPU needs its sleep - just like I do... :-) [size="1"][font="Arial"].[u].[/u][/font][/size]
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