How to read system eventlog using java program in windows?

How to read system eventlog using java program in windows?
is there any java class available to do this ? or any one having sample code for this?
Your friend Zoe

Hi,
There is no java class for reading event log in windows, so we can do one thing we can use windows system 32 VBS script to read the system log .
The output of this command can be read using java program....
we can use java exec for executing this system32 vbs script.
use the below program and pass the command "eventquery"
plz refer cscript,wscript
import java.io.*;
public class CmdExec {
public static void main(String argv[]) {
try {
String line;
Process p = Runtime.getRuntime().exec("Command");
BufferedReader input =
new BufferedReader
(new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null) {
System.out.println(line);
input.close();
catch (Exception err) {
err.printStackTrace();
This sample program will list all the system log information....
Zoe

Similar Messages

  • How to read system evenlog using java program in windows

    How to read system evenlog using java program in windows???
    is there any java class available to do this ? or any one having sample code for this?
    Your friend Zoe

    Welcome to the Sun forums.
    >
    How to read system evenlog using java program in windows???>
    JNI. (No.)
    >
    is there any java class available to do this ? or any one having sample code for this?>You will generally get better help around here if you read the documentation, try some sample code and come back with a specific question (hopefully with an SSCCE included).
    >
    Your friend Zoe>(raised eyebrow) Thank you for sharing that with us.
    Note also that one '?' denotes a question, while 2 or more generally denotes a dweeb.

  • How to read Korean characters using Java program?

    In Oracle table, i am having Korean characters, how to read those characters using JDBC and insert into SQL Server?
    NLS_NCHAR_CHARACTERSET is UTF8

    What data type is the column in the Oracle table? The NLS_NCHAR_CHARACTERSET would control the encoding of NCHAR and NVARCHAR2 columns. The NLS_CHARACTERSET would control the encoding of CHAR and VARCHAR2 columns.
    Justin

  • How to change system time through java program

    Hi
    I want to know, how to change system time through java program.
    give me a idia with example.
    Thanks

    There isn't any core Java API for this. Use JNI or call an external process with Runtime.exec().
    ~

  • Set system classpath using java program??

    Hi,
    I want to set the System classpath using java program. Can somebody please tell how to do this.
    Prashant

    but this will set the classpath for that particular JVM only.
    Isn't it??? I want that of SYSTEM so that user can access that class path from any JVM instance.
    Prashant

  • How to uncompress zip files using java program

    hai,
    please give some sample code to decompress the zip file.
    how to uncompress zip files using java program
    thanking you
    arivarasu

    http://developer.java.sun.com/developer/technicalArticles/Programming/PerfTuning/
    Scroll down to 'Compression'

  • How to open specific port using java program

    Hello,
    I want to open ,close port using java comm.plz help me how can i do it.is it possible
    by using java program.later i want to use that specific port to accept the server socket connection .plz
    help me.

    i try this java program.*but it get block in accept method*.tht mean i m not able to make connection with port.
    import java.sql.SQLException;
    import java.io.IOException;
    import java.net.ServerSocket;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    class MakeConn
         public final static int PORT = 7788;
    public static java.net.Socket clientSocket = null;
    public static java.io.PrintWriter pw = null; // socket output stream
    public static java.io.BufferedReader br = null;
    public static ServerSocket server_socket;
         public static void main(String[] args) throws SQLException
         try {
              server_socket = new ServerSocket(PORT);
    clientSocket = server_socket.accept();
    System.out.println("CLIENT>>>" + clientSocket);
         br = new java.io.BufferedReader(new java.io.InputStreamReader(clientSocket.getInputStream()));
    pw = new java.io.PrintWriter(clientSocket.getOutputStream(), true);
    String message = br.readLine().trim();
    System.out.println("message is"+message);
    pw.close(); // close everything
    br.close();
    clientSocket.close();
         catch (Exception ex) {
    ex.printStackTrace();
    }

  • How to read pdf files using java.io package classes

    Dear All,
    I have a certain requirement that i should read and write PDF files at runtime. With normal java file IO reading is not working. Can any one suggest me how to proceed probably with sample code block
    Thanks in advance.

    hi I also have the pbm. to read pdf file using JAVA
    can any body help meWhy is it so difficult to read the thread you posted in? They say: java.io is pointless, use iText. So why don't you?
    or also I want to read a binary encoded data into
    ascii,
    can anybody give me a hint how to do it.Depends on what you mean with "binary encoding". ASCII's binary encoding, too, basically.

  • How to Read An Attachment Using Java Mail

    Hi
    I Am Able To Read The Mail Using Java Mail ,but Unable To Read The Attachment Which Comes Along With The Mail.
    Please Help Me , In Reading The Attachment.

    Hi
    I Am Able To Read The Mail Using Java Mail ,but
    t Unable To Read The Attachment Which Comes Along
    With The Mail.
    Please Help Me , In Reading The Attachment.Do you mean:
    - I only recieve .txt or .doc attachments and I want to see the contents? Or could you get a .jpg as well?
    or
    - Do you need to seperate the attachment from the e-mail and then view it?

  • How to read outlook mail using java

    Hi,
    I am new to javamail ,
    I want to read outlook mail using java
    thanks
    Edited by: My_Problems on Jun 20, 2008 11:13 AM

    Hi!
    See Java Api Msgparser in GNU General Public License...
    A parser for .msg Files in Java :
    [http://auxilii.com/msgparser/|http://auxilii.com/msgparser/]
    Use POI... Apache POI - Java API To Access Microsoft Format Files...
    regards,

  • How to read SGML files using Java

    I've got a text categorisation test collection called Reuters-21578 for my Information Retrieval project. It is distributed in 22 files. Each of the first 21 files (reut2-000.sgm through reut2-020.sgm) contains 1000 documents, while the last (reut2-021.sgm) contains 578 documents. The files are in SGML format. Each of the 22 files begins with a document type declaration line:
    <!DOCTYPE lewis SYSTEM "lewis.dtd"> The DTD file lewis.dtd is included in the distribution. Following the document type declaration line are individual Reuters articles marked up with SGML tags.
    My questions is how to write a java program to read those 21578 documents or transform them into 21578 seperated text files.

    I guess I missed something. What is Renes link?. The
    parser stuff isn't really what I'm looking for. I'm
    a new at and just learning java and I just want to
    know the easiest way to read a SGML file. Should I
    use a buffered Reader with a Pushback Input Stream?Hang on.....you want to just read the file without intelligently extracting the SGML data contained within and so have no need of a parser?
    Well, in that case, its just text.....so just use BufferedReader or whatever to read the text data. If I understand you correctly, all you really wanted to ask was "how do I read a text file?"

  • How to access system registry through java program

    Friends
    I have to access System registry of Windows 2000 by Java program. I don't know how to access the registry by using java code. Please help me. Else
    I want to create a setup file for my application. before setup my application i have to check whether the system has JVM or not. If its not then i have to install JVM first and then my application. so i need to access system registry. please give me a solution for this.
    Thanks in advance
    Ramesh

    I don't know how to access the registry
    by using java code. You can't, without using a native interface (JNI type) library.
    This is one, there are others, do a Google search:
    http://www.bayequities.com/tech/Products/jreg_key.shtml

  • How can I trasfer file using java program (from NT to Unix)

    Hi all,
    I want to transfer a text file from Windows NT to Unix machine inside the Java program.
    How should i do it.
    Thanks in advance.
    Regards
    Rajeev

    you have several options:
    - make your system administrator software install software on Unix and NT so that you can see a directory on the Unix machine from your NT machine, and just copy the file there
    - use FTP to put the file on the Unix machine
    Jesper

  • How to set environment variables using java program

    Hi all
    I want to set environment variables on windows 98/200/xp system, such as path and classpath using a java program.
    How to do this using a java program.
    Any body plz helppppppppp.

    #1 05-02-2003, 07:38 AM
    Goodz13 Join Date: Jan 2002, Posts: 985
    Location: Halifax, NS, Canada
    Reputation:
    Java FAQ's and tutorials
    Java FAQ's
    Path and ClassPath:
    PATH
    In Windows 9x you would set it up in the autoexec.bat file
    ie.
    SET PATH=%PATH%;c:\jdk1.4.2\bin\;
    where c:\jdk1.4.2\ is the path where you installed Java.
    In Windows 2000 and XP
    Right click on My Computer->Properties->Advanced Tab->Environment Variables... Button.
    If you see a PATH in System Variables, click that and edit it. If you don't, you will need to create a new System variable.
    It should look something like this:
    %SystemRoot%\system32;%SystemRoot%;c:\jdk1.4.2\bin\;
    Any querry email me to [email protected]
    Answer by
    Rajasekhar Goli
    DS UNICS Infotech

  • How do i monitor performance in the system of a Java program in Windows XP?

    I want to record the CPU usage and Memory usage on an hourly basis programatically, for an already running java class in Windows XP environment for the purpose of testing the Java class. The recording has to be done independent of the java class.By Cpu usage and Memory usage , i need to know how much of the computer's memory and CPU has been used by the java class.
    I tried the HPROF tool available with J2SE 5.0, but it gives the details of each of the functions' usage in the program's allocated space in memory. moreover, it is not independent of the execution of the class.
    The other option is to make use of the Performance tool available in Windows Xp->Administrative tools. This is a complex procedure, and i am not sure of how to proceed in this direction.

    You can use the windows performance monitor (perfmon.exe / perfmon.msc). I don't know wther it is also included in the XP Home Edition. But this is the tool you are looking for. It can display the information in realtime but also can write to a protocoll.
    Here's a shor description of what to do (i have a german windows so i'm more or less guessing the english terms)
    - Start perfmon.msc
    - In the tree on the you can see "systemonitor" (the realtime display) and "performance protocolls and warnings"
    - open "performance protocalls and warnings", the first sub element should be something like"performance protocalls" or "performance indicator"
    - open the context menu for it and create a new protocoll settings.
    - add the information to it you are interested in and make other changes if you want
    - start the new configuration
    once you have the information you can display it it in the systemmonitor by selecting "display information from protocal" from the toolbar
    It will take some time till you know what you are doing (and most of the information the performance monitor is useless to 99% of the people). But its a quite usfull tool once you know how to use it

Maybe you are looking for

  • Activity Monitor and Network Usage??

    I'd like to get an idea of my network usage per month prior to signing up for a service plan, and I notice that the Network tab of Activity Monitor will track Data received. When or how does the number shown there get reset to zero? What would be the

  • Customer line item cleared but still it shows open item in FBL5N

    Hi, We have cleared one customer open item. Posting date of Invoice is 08/12/2010 and Posting date of Incoming payment is 10/12/2010. But in FBL5N system still it shows the same cleared line as open item even though it is showing cleared document in

  • Purchase not made by me

    A couple of months ago, I got an email stating that I had purchased apps from the App Store (which I did not). Item Number Description Unit Price 1 Talking Larry the Bird for iPad, v1.0, Seller: Outfit7 Ltd. (9+) Write a Review Report a Problem $3.99

  • Call to BPM WebServive and Return BPM GUID

    Hello, When calling the web service to start a BPM process, we would like the web service to return to the calling application the guid of the BPM process that was created. The purpose of this is to provide the calling application a level of traceabi

  • Disable transition on mouseclick

    I followed an earlier thread on this - if you have four boxes on screen and each is a hyperlink, when users click anywhere other than the boxes the slide transitions. The recommended solution at the time was to link the boxes to other keynote files.