Batch Job How To?

VMLENZA

New Member
Where can I learn how to write batch jobs? I want to write a job for Event Viewer to write a line to a file for certain events; i.e., I want a log of users logging on and off as well as a line for certain error events in my own format to isolate whatever events I choose. Is there a list of commands? I can't find anything by searching for batch info.

I'd like to set up schizophrenic identities of myself as administrator, user, etc, and keep track of modifications made to each id by using a batch job to enter a line into my 'log'. Then I can have one log that lists manually run maintenance tasks (with a time stamp to cross-reference later with event log. I would also like to write notes regarding installation of new tools, etc. to this file. I may need two logs to allow Event Viewer full write access (I can always merge the files later) -or can I write to the same file? - can it be a Excel file?

Maybe there's a tool that does this already.
 

My Computer

System One

  • CPU
    INTEL CORE 2DUO CPU T5250
    Motherboard
    MOBILE INTEL 965 EXPRESS CHIPS
    Memory
    2.00 GB
    Graphics card(s)
    (n/a) 800x600 (1Hz)
    Hard Drives
    FUJITSU MHW2160BH PL
Two good answers 1) How to make a batch job... johngalt posted an SC link and 2) Command Prompt - Brinks posted a link. Both links could keep me busy for years. In the meantime, HP is taking back my machine to reinstall because of SMBIOS problems. (Is it something I did?) Withdrawals are already setting in. Thank goodness I have my Mom's XT to track Faye. and thanks to Brinks and johngalt!!
 

My Computer

System One

  • CPU
    INTEL CORE 2DUO CPU T5250
    Motherboard
    MOBILE INTEL 965 EXPRESS CHIPS
    Memory
    2.00 GB
    Graphics card(s)
    (n/a) 800x600 (1Hz)
    Hard Drives
    FUJITSU MHW2160BH PL
Maybe there's a tool that does this already.

Hi Vmlenza,

Unfortunately a batch file doesnt have the capability to read the windows event service, It is quite easy todo this with PowerShell however and a addon called PowerGUI, checkout this thread for more information http://www.vistax64.com/beta-software/164001-powershell-toolbox.html

Its also easy todo this with a vbscript, This Microsoft topic can get you started and it is quite easy Understanding the Event Model and this article should also help if you make a few small modifications ;) WMI tutorial to search Security Event Log for Administrator Logons Event ID 675

Steven
 

My Computer

Back
Top