CHECK EVENT TAG.BAT

From TDiWiki

Jump to: navigation, search

Rem
Rem © Copyright 2007, TECSys Development, Inc. , all rights reserved
Rem
Rem TITLE - CHECK_EVENT_TAG.BAT
Rem
Rem IDENT - CONSOLEWORKS /V3.5-0/
Rem
Rem Abstract:
Rem This script is designed as an example of how to tag that
Rem an event has happened.
Rem
Rem %1 = Console Name
Rem %2 = Event Name
Rem %3 = Event Sequence Number
Rem %4 = Event Context File - delete before this script ends
Rem %5 = User supplied Contact
Rem %6 = User supplied parameter
Rem
Rem Installation:
Rem
Rem Author:
Rem TECSys Development, Inc.
Rem 1600 10th Street
Rem Suite B
Rem Plano, TX 75074
Rem (800) 695-1258 or (972) 881-1553
Rem http://www.tditx.com
Rem support@tditx.com
Rem

FOR /F "delims=: tokens=1,2,3,4*" %%a in (%~4) DO (
IF "%%a"=="AUTHORIZATION" SET AUTHSTR=%%b:%%c:%%d
)

SET FNAME=%CONWRKS_ROOT%\%~5.txt
dir %FNAME%

IF %ERRORLEVEL%==0 GOTO CLEAN_UP

SC \\DRAGENT START %~6

"%CONWRKS_EXE%\CWTERM" /server=127.0.0.1 /port=%CONWRKS_BINDPORT% /auth=%AUTHSTR% create event WMI_SERVICE_RESTART "'Attempting restart of Service %6'" /console=%1

CLEAN_UP

"%CONWRKS_EXE%\CWTERM" /server=127.0.0.1 /port=%CONWRKS_BINDPORT% /auth=%AUTHSTR% ack event /console=%1 /sequence=%3 /comment="'cHECK_EVENT_TAG.BAT(%6)'"
"%CONWRKS_EXE%\CWTERM" /server=127.0.0.1 /port=%CONWRKS_BINDPORT% /auth=%AUTHSTR% purge event /console=%1 /sequence=%3
DEL %FNAME%
DEL %4

Personal tools