Mattachew Posted February 21, 2019 Share Posted February 21, 2019 Hi all, I've currently got a script which runs every morning but I manually need to start the script. This sits on a server, the server only gets rebooted once every 2 weeks. My question is how would I automatically run the script every day since I can't run it on startup as the server stays on 24/7 ? ------- When running the script it goes and finds an .exe file opens it and enters in a username and password. The image attached is of the AutoIt v3 Script which I need to get automated. Link to comment Share on other sites More sharing options...
alienclone Posted February 21, 2019 Share Posted February 21, 2019 can you use the Windows Task Scheduler? or maybe... do a search If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version Link to comment Share on other sites More sharing options...
Mattachew Posted February 22, 2019 Author Share Posted February 22, 2019 Hi @alienclone I've tried through Windows Task Scheduler but get the following error: Task Scheduler failed to start "\<SCRIPT NAME>" task for user "<ACCOUNT USERNAME>". Additional Data: Error Value: 2147750687. Link to comment Share on other sites More sharing options...
careca Posted February 22, 2019 Share Posted February 22, 2019 you could have script running also 24/7 and only do the task after x ammount of time. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
alienclone Posted February 22, 2019 Share Posted February 22, 2019 well, a simple way would be to do like @careca said. put the entire script inside a While...WEnd and tell it to Do NowTime until $specificTime i always put a sleep in with my Do just to make sure it doesnt bog down the cpu just be aware that if you make your sleep longer than whatever time measuring unit you choose, it wont match every day e.g. if you tell it to check for an exact time (1:47) then your sleep cant be longer than a minute or you miss the chance of the time matching because it could skip over your desired time before checking, so if you want longer sleeps, then you would check current time and see if, say, just the hour matches. etc. If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version Link to comment Share on other sites More sharing options...
LukeLe Posted February 22, 2019 Share Posted February 22, 2019 @alienclone IMO, whenever you finished the daily task, just calculate how much time the script has to wait until the next run, and sleep for the whole of that calculated time alienclone 1 Wondering who uses AutoIT and what it can be used for? Link to comment Share on other sites More sharing options...
alienclone Posted February 22, 2019 Share Posted February 22, 2019 2 hours ago, LukeLe said: @alienclone IMO, whenever you finished the daily task, just calculate how much time the script has to wait until the next run, and sleep for the whole of that calculated time thats a good idea, as long as they dont need the script to run at a precise time. reading the function description for Sleep() just now, which ive never read before, makes it sound as if it cannot be counted on for accuracy. but my god, i would have never imagined you could run a sleep for UP TO 24 DAYS, that just sounds like craziness to me. If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version Link to comment Share on other sites More sharing options...
Dwalfware Posted February 22, 2019 Share Posted February 22, 2019 If I recall from many years ago if you compile it there is a way to restart the compiled script, then just add the time. or or Make a helper script, what monitors you script is running and restarts it at time Link to comment Share on other sites More sharing options...
LukeLe Posted February 23, 2019 Share Posted February 23, 2019 (edited) @alienclone The accuracy as mentioned in the doc as maybe slightly longer. So how precisely do you want to achieve? Quote Note that other running processes often affect the timing accuracy and so pauses are likely to last for slightly longer than requested. Edited February 23, 2019 by LukeLe Wondering who uses AutoIT and what it can be used for? Link to comment Share on other sites More sharing options...
careca Posted February 23, 2019 Share Posted February 23, 2019 I was under the impression that something like timer_init and timer_diff were very accurate, so maybe they can be put to use. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Bert Posted February 23, 2019 Share Posted February 23, 2019 simpler way - just use the time functions to look for a specific time. once it is that time, then kick off the function. Mattachew 1 The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Juvigy Posted February 25, 2019 Share Posted February 25, 2019 The error code 2147750687 means "task already running". Task Scheduler is the best thing to use for this... 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