Guest PaulF Posted November 14, 2004 Posted November 14, 2004 I need to save a variable for use in AutoIt to determine how many times a script has run. Is the easiest way to store a variable in the registry? If so, what do you recommend as the best convention for picking a user registry address? PaulF
this-is-me Posted November 14, 2004 Posted November 14, 2004 (edited) RegWrite("HKCU\Software\yourscriptname", "runs", "REG_SZ", $runtimes) Edited November 14, 2004 by this-is-me Who else would I be?
ezzetabi Posted November 15, 2004 Posted November 15, 2004 Or use a ini file. $c = IniRead('@scriptdir & '\runs.ini','Main','NumOfTimes',1) $c = $c +1 IniWrite('@scriptdir & '\runs.ini','Main','NumOfTimes',$c)
JSThePatriot Posted November 15, 2004 Posted November 15, 2004 I would like to ask before offering a different solution what it is that you would need to count how many times a script has run for... and would the script be looping, or would it actually close open close open etc? Let me know. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
Guest PaulF Posted November 17, 2004 Posted November 17, 2004 I would like to ask before offering a different solution what it is that you would need to count how many times a script has run for... and would the script be looping, or would it actually close open close open etc?The script is one I run at the end of each day to do maintenance - clone partitions, cleanup files, run AdAware, SpyBot, etc. My backup procedure is to clone the data partition each run of the script. On the seventh run, I want to clone the entire disk. I use the run count to decide if this is my seventh run. I would rather do this than use day of the week, because I may be away from ny computer for some days, and I want to base the counting on days I actually used the computer.PaulF
scriptkitty Posted November 17, 2004 Posted November 17, 2004 Ini or registry is about the same. $c = IniRead('@scriptdir & '\runs.ini','Main','NumOfTimes',1) $c = $c +1 if $c/7=int($c/7) then clonedisk() IniWrite('@scriptdir & '\runs.ini','Main','NumOfTimes',$c) something like that. $c=Regread("HKCU\Software\yourscriptname", "runs", "REG_SZ", 1) $c = $c +1 if $c/7=int($c/7) then clonedisk() RegWrite("HKCU\Software\yourscriptname", "runs", "REG_SZ", $c) AutoIt3, the MACGYVER Pocket Knife for computers.
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