zichd Posted August 5, 2005 Share Posted August 5, 2005 Hi, firstly thanks for great site and scriptin app Newbie here Have the following simple script which works well -------------------------------------------------------- $i = 0 While $i <= 100 WinWaitActive("GetLastError") Send("{ENTER}") $i = $i + 1 WEnd -------------------------------------------------------- Does anyone know how to get it to log or email or inform us when the script has caught the "GetLastError" wreaking havoc on my system? Any sort of notification would suffice Thanks in advance Link to comment Share on other sites More sharing options...
Valuater Posted August 5, 2005 Share Posted August 5, 2005 1 msgbox(0,"Notice", "your message here") 2 #include<file.au3> _FileWriteLog("C:\Notice.log", "Your message here") 8) Link to comment Share on other sites More sharing options...
herewasplato Posted August 5, 2005 Share Posted August 5, 2005 I'm not sure why you need a While/WEnd loop around the WinWaitActive line. The script will just sit there and wait for that window to become active. Does the window/message show up several times? If so, just wrap the code below in your loop - you might get 100 e-mails. I would send it to a pager/phone/PDA: ; get bmail from this link: ; http://www.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm WinWaitActive("GetLastError") Send("{ENTER}") $S_bmail = "path to bmail.exe" $S_SMTP_Server_switch = " -s SMTP server name goes here" $S_TO_address = " -t alias@.com" $S_FROM_address = " -f AutoIt-Bmail" $S_Text_Subject = " -a GetLastError" $S_Text_Body = " -b GetLastError" Run($S_bmail & $S_SMTP_Server_switch & $S_TO_address & $S_FROM_address & $S_Text_Subject & $S_Text_Body) Caveat - the code above was not tested after being sanitized - I might have missed a quote/space or two. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
zichd Posted August 5, 2005 Author Share Posted August 5, 2005 Great!, works fine thanks for the help Do need looping as the machine only reboots about 1once a week and error may popup a few times during the week.Muchly appreciatedTaI'm not sure why you need a While/WEnd loop around the WinWaitActive line. The script will just sit there and wait for that window to become active. Does the window/message show up several times? If so, just wrap the code below in your loop - you might get 100 e-mails.I would send it to a pager/phone/PDA:; get bmail from this link: ; http://www.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm WinWaitActive("GetLastError") Send("{ENTER}") $S_bmail = "path to bmail.exe" $S_SMTP_Server_switch = " -s SMTP server name goes here" $S_TO_address = " -t alias@.com" $S_FROM_address = " -f AutoIt-Bmail" $S_Text_Subject = " -a GetLastError" $S_Text_Body = " -b GetLastError" Run($S_bmail & $S_SMTP_Server_switch & $S_TO_address & $S_FROM_address & $S_Text_Subject & $S_Text_Body)Caveat - the code above was not tested after being sanitized - I might have missed a quote/space or two.<{POST_SNAPBACK}> 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