Jump to content

Log script action?


 Share

Recommended Posts

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:

Link to comment
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]

Link to comment
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}>

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...