Sign in to follow this  
Followers 0
zichd

Log script action?

4 posts in this topic

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

:whistle:

Share this post


Link to post
Share on other sites



1

msgbox(0,"Notice", "your message here")

2

#include<file.au3>

_FileWriteLog("C:\Notice.log", "Your message here")

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

Great!, works fine thanks for the help :whistle:

Do need looping as the machine only reboots about 1once a week and error may popup a few times during the week.

Muchly appreciated

Ta

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.

<{POST_SNAPBACK}>

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