Sign in to follow this  
Followers 0
Orao

sheduled updates

4 posts in this topic

How could i write following script:

1.The script checks for the date and time at start-up (it launches every-time at start-up)

2. If it is Monday and its less that 10 o clock in the morning, then start the updater once.

3. After that reboot the computer, and don't start the updater until 7 days have passed and its again before 10. o clock in the morning.

Thank you a lot for your help

Share this post


Link to post
Share on other sites



Orao,

- Use the @MDAY and @MON macros to get the date.

- Use the @WDAY macro to see if it is Monday and the @HOUR macro to check the time.

- Save the current date in an ini file or the registry so you can check how long it has been with _DateDiff.

- Use Run the updater - use Shutdown to reboot.

It is all in the Help file - just use it. :unsure:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

what i would do and curently have is.

$locate = "C:\(location of script with the .exe)"

RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" , (name registry string) , "REG_SZ" , $locate)

with this script above its a 1 time deal. what it does is add a registry entry so at the boot up for your windows machine it will run your script.

at every start up. so for your instance your .exe. you will just need to change the location to where your .exe is located. and also name the registry string to what ever you want probably what you call your script.

now that was for the start up but for the specific times such as monday at 9:00 am what you should dois google schedule tasks in windows 7. but here is how to schedule a task to run in xp. what it does is when you compile a .exe from script in autoit you would be able to have your .exe run on certain times of the day or week or month you decide so for your case on monday 9:00 am. the OS has a scheduler to do daily weekly and ext. i like it better b/c it will tell you if it failed to run script and extra features. you should check it out.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thanks a lot for the replies! I will still try your suggestions.

Yes i had some problems when trying with Windows xp and task scheduler, the script was always running hidden so it didn't work.

But now i figured out how to make task scheduler run the script in visible mode.

I will also try your suggestion "Melba23"

Thanks a lot!

Edited by Orao

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0