Jump to content

Windows Event Viewer, with no DLL.


Recommended Posts

I hope I am posting in the right forum.

After a lot of time, and effort, I have discovered how to do event logs with autoit. BTW: Autoit is an excellent tool.

As the title says no DLL. I did a lot of searching on the forums, and never really found a way. The ones I found would not do "line breaks" correctly. I saw quite a few involving a DLL, but I have no clue how to do that!

This works on Windows 7 natively, but earlier versions may need to download the "resource kit".

I have created a script that reads the output (a text file) of a command line virus scanner (a2cmd if you were curious). This way I can right click a folder, and and scan that folder.

I created a "custom" log in "event viewer". Using this utility: Event Log Creation Utility.

This way I have a snazzy way of keeping track of virus scans. When I do get one, I open "event viewer". Grab the name of it, and then Google it.

This is the "command line" that starts it going.

a2cmd.exe /f="%1" /r /n  /l=d:\\a2cmd\\a2cmd.log & d:\\a2cmd\\testing.au3 & pause"

This is the script that does the writing to "event viewer".

#include <Array.au3>
$text = FileRead("D:\A2cmd\a2cmd.log")
Run("eventcreate /T Information /ID 100 /L Virus-Log /SO Anti-Virus /D " & CHR(34) & $text & CHR(34), "", @SW_HIDE, 2)

This the reg file that gives you the right click option.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\a2cmd]
@="Emsisoft Commandline Scanner"

[HKEY_CLASSES_ROOT\Directory\shell\a2cmd\command]
@="cmd /c D:\\A2cmd\\a2cmd.exe /f=\"%1\" /r /n  /l=d:\\a2cmd\\a2cmd.log & d:\\a2cmd\\testing.au3 & pause"

The output looks like this. How it looks here, is how it look in "event viewer".

Emsisoft Commandline Scanner v. 5.1.0.2
(C) 2003-2010 Emsi Software GmbH - www.emsisoft.com

Emsisoft Commandline Scanner - Version 5.1
Last update: 4/18/2011 6:11:04 PM

Scan settings:

Objects:           D:\TEMP
Scan archives:     Off
Heuristics:        Off
ADS Scan:          On

Scan start:        5/24/2011 7:34:17 PM

D:\TEMP\file.txt

Scanned

Files:             1
Traces:            0
Cookies:           0
Processes:         0

Found

Files:             0
Traces:            0
Cookies:           0
Processes:         0


Scan end:          5/24/2011 7:34:26 PM

I hope all this makes sense.

I will try to answer any questions about this.

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...