vortexed Posted March 31, 2013 Posted March 31, 2013 I can't seem to get my head around this one. I feel like it's at the tip of my tongue but it won't come out. I am basically trying to Write to an INI file accross the network on a daily basis. I want to put this logic in a While 1 .... Wend loop that runs constantly and I am trying to avoid writing to this ini file multiple times in a day, I want to write to this ini file every day, but once a day. Hope this makes sense. I only need help with a logic so that I only date this once a day. I do not need exact code nor syntax for writing to an ini file, it's all in the help document and thank god I can read. Thank you for looking at this. here is a sample Local $var1 = "blah" While 1 Sleep(Random(300000, 600000, 1));Gives me control over how often I am executing the code below.... ...some code ...some code WEnd
BrewManNH Posted March 31, 2013 Posted March 31, 2013 Look at the time and date macros and use then in an If/Then statement to figure out the time and day to see if you should write to the file again. vortexed 1 If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
somdcomputerguy Posted March 31, 2013 Posted March 31, 2013 Ya, see if you've already written what you want to write. Measure twice, cut once.. vortexed 1 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
kylomas Posted March 31, 2013 Posted March 31, 2013 (edited) vortexed, This Sleep(Random(300000, 600000, 1));Gives me control over how often I am executing the code below.... runs the while loop every 5 to 10 minutes. In your OP you say multiple times in a daybut do not mention that the times should be random (as hinted to by the above code). Also, does this accross the networkmean network share? Does the script only process the INI file or do you want to do other things in the script? kylomas Edited March 31, 2013 by kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill
vortexed Posted March 31, 2013 Author Posted March 31, 2013 Oh god, why didn't I think of that. Thank you guys, I was able to make it happen. I was way over-thinking it. Func Manifest() Local $DateCalculator = @MON & "." & @MDAY & "." & @YEAR Local $Manifest = IniRead($GlobalINI, "MANIFEST", @ComputerName, "NOTSET") ;Local $DateCalculator = @MON & @Day & @YEAR If $Manifest <> $DateCalculator Then IniWrite($GlobalINI, "MANIFEST", @ComputerName, $DateCalculator) ConsoleWrite($DateCalculator) EndIf EndFunc ;==>Manifest
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