arminius Posted March 4, 2008 Posted March 4, 2008 I'm trying to write a script that will automatically run all my spyware scanners, but I don't want them running all at the same time, so wanted to give the first one an hour to finish then it will execute the next program, here is what I have so far CODERun("C:\Program Files\Windows Defender\MSASCui.exe") MouseClick("left", 480, 260, 1) MouseClick("left", 480, 300, 1) WinWait("Untitled", 3600) Run("C:\Program Files\Spybot - Search & Destroy\SDMain.exe") WinWait("Untitled", 4) MouseClick("left", 280, 150, 1) winwait seems to work fine for causing delays of 4 seconds, I assumed that 3600 second delay would make it wait an hour, but it works far to well, it doesn't execute spyboy at all. any suggestions?
ofLight Posted March 4, 2008 Posted March 4, 2008 (edited) I assumed that 3600 second delay would make it wait an hourSleep(3600) is just 3.6 seconds Sleep(5*60*1000) ;<<-------- 5 minutes Normally I use TimerDiff() for sleeps that long instead of Sleeps. I guess Sleep and WinWait use different time formats. Edited March 4, 2008 by ofLight There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly
JamesDover Posted March 4, 2008 Posted March 4, 2008 (edited) Runwait("C:\Program Files\Spybot - Search & Destroy\SDMain.exe") Runwait is what I use and seems to work great. Edited March 4, 2008 by JamesDover
arminius Posted March 4, 2008 Author Posted March 4, 2008 Sleep(3600) is just 3.6 seconds Sleep(5*60*1000) ;<<-------- 5 minutes Normally I use TimerDiff() for sleeps that long instead of Sleeps. I guess Sleep and WinWait use different time formats. I'm sorry but I'm an extreme newb, what is the coding for TimerDiff() that would make the script pause for an hour?
GEOSoft Posted March 4, 2008 Posted March 4, 2008 (edited) I'm trying to write a script that will automatically run all my spyware scanners, but I don't want them running all at the same time, so wanted to give the first one an hour to finish then it will execute the next program, here is what I have so farCODERun("C:\Program Files\Windows Defender\MSASCui.exe")MouseClick("left", 480, 260, 1)MouseClick("left", 480, 300, 1)WinWait("Untitled", 3600)Run("C:\Program Files\Spybot - Search & Destroy\SDMain.exe")WinWait("Untitled", 4)MouseClick("left", 280, 150, 1)winwait seems to work fine for causing delays of 4 seconds, I assumed that 3600 second delay would make it wait an hour, but it works far to well, it doesn't execute spyboy at all.any suggestions?WinWait can not point to "Untitled" for Spybot because the window with the title "Untitled" will never exist.At the top of the script use Opt("WinTitleMatchMode", 2)Change your WinWait toWinWaitActive("Spybot")Also I'm not sure what the text is in the Title bar for Windows defender but you would use that in the WinWaitActive() for the Windows Defender portion of your code. Also take note that window titles are case sensitive.For Spybot weapon_x has also given you some good advice, Use the commandline options but you will also need the ProcessExists that I gave in the other reply. Edited March 4, 2008 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
arminius Posted March 4, 2008 Author Posted March 4, 2008 Runwait("C:\Program Files\Spybot - Search & Destroy\SDMain.exe")Runwait is what I use and seems to work great.but how does it know how long to wait?
weaponx Posted March 4, 2008 Posted March 4, 2008 Once again I am here to say why are you "manually" automating Spybot? It has command line options to do all of this crap automatically and silently.http://www.safer-networking.org/en/faq/30.html
GEOSoft Posted March 4, 2008 Posted March 4, 2008 I'm sorry but I'm an extreme newb, what is the coding for TimerDiff() that would make the script pause for an hour?1 hour is 60000 miliseconds. Like it was pointed out earlier you should be delaying only for the lenghth of time that the process exists. After the run lines use this but change the process name as required. While ProcessExists("SDMain.exe") Sleep(2500) WEnd George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
Tvern Posted March 4, 2008 Posted March 4, 2008 1 hour is 60000 miliseconds.I was under the impression an hour is 3600000ms. 60000 is a minute.
GEOSoft Posted March 4, 2008 Posted March 4, 2008 I was under the impression an hour is 3600000ms. 60000 is a minute. Right you are. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
weaponx Posted March 4, 2008 Posted March 4, 2008 $run = RunWait ( $root & "\SpybotSD.exe /taskbarhide /autocheck /autoupdate /autoclose" , $root & "\")
GEOSoft Posted March 4, 2008 Posted March 4, 2008 $run = RunWait ( $root & "\SpybotSD.exe /taskbarhide /autocheck /autoupdate /autoclose" , $root & "\")That works for Spybot but the OP is attempting to to write a script that will automatically run all my spyware scanners and I don't know what scans are included in "all" nor what the commandline parameters would be for the others. However command line and While ProcessExists() are the way to go where possible. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
weaponx Posted March 4, 2008 Posted March 4, 2008 Fine. Heres one for Windows Defender: RunWait('MSASCUI.EXE -UpdateAndQuickScan') Heres one for Adaware: $run = RunWait ( $root & "\Ad-Aware.exe /full +silent +archives" , $root & "\") Shall I continue?
GEOSoft Posted March 4, 2008 Posted March 4, 2008 Shall I continue?Only if you feel like it. It's obvious that Google will provide solutions for most. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
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