kkurniawan Posted January 14, 2006 Posted January 14, 2006 Hi there, I have an application that writes an error to log file and I write the error to windows event log manually. I wonder if I can use AutoIt script to specify the location of the error file in the script and the script reads the error file content and write to windows event log automatically. This is what I have so far: Set WshShell = WScript.CreateObject("WScript.Shell") strCommand = "eventcreate /T Error /ID 100 /L CP-Link /D " & _ Chr(34) & "Cannot connect to unit." & Chr(34) WshShell.Run strcommand Any help/suggestion is highly appreciated. Thanks, Senukung
Micha1405 Posted January 17, 2006 Posted January 17, 2006 (edited) With AutoIt you can use: $SystemEvent='eventcreate /T Error /ID 999 /L SYSTEM /SO AutoItScript /D "A Event Created with AutoIt "' Run(@ComSpec & " /c " & $SystemEvent, "", @SW_HIDE) Be careful with the OS Language Entry Application is in German ANWENDUNG tested with windows XP good luck for your script Edited January 17, 2006 by Micha1405 My TrayToolBar
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now