Orao Posted April 18, 2011 Posted April 18, 2011 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
Moderators Melba23 Posted April 18, 2011 Moderators Posted April 18, 2011 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. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Cars0n66 Posted April 18, 2011 Posted April 18, 2011 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.
Orao Posted April 18, 2011 Author Posted April 18, 2011 (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 April 18, 2011 by Orao
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