yyyy273 Posted May 29, 2008 Share Posted May 29, 2008 I have been trying to use Valuater's time machine 2 script to have a program run early in the morning when no one is on the computer. The problem is that it doesn't run. ; Time Machine #2 $start = "1:30" While 1 $time = @HOUR & ":" & @MIN If $start = $time Then Run("notepad.exe") ExitLoop EndIf Sleep(2000) WEnd Exit I think the problem lays not within the code but within the settings on my computer. I have tried going to Display Properties and disabling the screensaver thinking that it could have caused the problem but no luck. I set system standby to never and turned off hibernation but that didn't help either. Any help would be appreciated. Thanks! Link to comment Share on other sites More sharing options...
Regency Posted May 29, 2008 Share Posted May 29, 2008 Try putting the$time statement out side the while.. dunno but i think that might screw it up Link to comment Share on other sites More sharing options...
yyyy273 Posted May 29, 2008 Author Share Posted May 29, 2008 Try putting the$time statement out side the while.. dunno but i think that might screw it upThen the $time wouldn't refresh and would stay at whatever time you started the script. Link to comment Share on other sites More sharing options...
Richard Robertson Posted May 29, 2008 Share Posted May 29, 2008 Is an error produced? Does the script stop running at that point in time? Have you tried a full path to notepad? Link to comment Share on other sites More sharing options...
yyyy273 Posted May 29, 2008 Author Share Posted May 29, 2008 Is an error produced? Does the script stop running at that point in time? Have you tried a full path to notepad?No error, script has been running for 24 hours or so now and nothing.I have run it before no problem making the $start = @HOUR & ":" & @MIN + 1 but its just when I leave it running overnight that it doesn't work. Link to comment Share on other sites More sharing options...
ResNullius Posted May 29, 2008 Share Posted May 29, 2008 I have been trying to use Valuater's time machine 2 script to have a program run early in the morning when no one is on the computer. The problem is that it doesn't run. ; Time Machine #2 $start = "1:30" While 1 $time = @HOUR & ":" & @MIN If $start = $time Then Run("notepad.exe") ExitLoop EndIf Sleep(2000) WEnd Exit I think the problem lays not within the code but within the settings on my computer. I have tried going to Display Properties and disabling the screensaver thinking that it could have caused the problem but no luck. I set system standby to never and turned off hibernation but that didn't help either. Any help would be appreciated. Thanks!@Hour returns in the range 00 to 23. $start = "1:30" should be written as $start = "01:30" for the comparison to be true. Link to comment Share on other sites More sharing options...
Richard Robertson Posted May 29, 2008 Share Posted May 29, 2008 I was thinking about digit count, but was unsure without the documentation. Res has pretty much found the problem for you. Link to comment Share on other sites More sharing options...
yyyy273 Posted May 29, 2008 Author Share Posted May 29, 2008 @Hour returns in the range 00 to 23. $start = "1:30" should be written as $start = "01:30" for the comparison to be true.Bingo!Thanks for everyones help! 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