java - Windows Event log file -
i have program reads file every time , want read event log file of windows ,how can location , read contents.
the logs stored in %systemroot%\system32\config directory .evt extension. within computer manager can export them .txt or .csv file.
windows vista/7/server2008 location, here is: %systemroot%\system32\winevt\logs
my code is:
string fileseperator = file.separator; string filepath = "c:" + fileseperator + "windows" + fileseperator + "system32" + fileseperator + "winevent" + fileseperator + "logs"; system.out.println("filepath :" + filepath); file f = new file(filepath); system.out.println("is directory :" + f.isdirectory()); the output:
filepath : c:\windows\system32\winevent\logs
is directory :false
why return not directory?
because file doesn't exist. said location %systemroot%\system32\winevt\logs. yet use c:\windows\system32\winevent\logs.
winevt != winevent.
Comments
Post a Comment