Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A better e-mail notification #2 (for NT now)

Status
Not open for further replies.

gupel

Technical User
Oct 3, 2002
57
CA
Follow by ChrisEsser’s message I wrote two batch scripts for Bootstarp and Savegroup notification for Windows.

First script sends AND prints bootstrap information.
Second one sends savegroup notification.

First:
++++++++++++++++++++
REM Put std input to a file

nsrlog -f "C:\Program Files\nsr\logs\botstrap.txt"

REM Send the file

type "C:\Program Files\nsr\logs\botstrap.txt"| smtpmail -s
Bootstrap -h mailserver user@com.com

REM Print the file

type "C:\Program Files\nsr\logs\botstrap.txt"| nsrlpr -
PPrinterName

REM Delete the file

del "C:\Program Files\nsr\logs\botstrap.txt"

+++++++++++++++++++++++

Second:

+++++++++++++++++++++++
REM Save std input to a file

find /v "12345678901234567890" > "C:\Program
Files\nsr\logs\savegroup.txt"

REM Get the first line as a subject
REM ONE LINE!!!!

for /F "tokens=1 delims=# usebackq" %%a in ("C:\Program
Files\nsr\logs\savegroup.txt") do set NW_SUBJECT_MESSAGE=%%
a & goto CONT

:CONT

REM Send the file

type "C:\Program Files\nsr\logs\savegroup.txt"| smtpmail -
s "%NW_SUBJECT_MESSAGE%" -h mailserver user@com.com

++++++++++++++++++

I use W2K, NW 6.2.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top