Previous Next

Thread: LogParser not returning correct output

Last post 04-30-2008 1:47 AM by dinhn. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 04-23-2008, 9:45 AM

    • dinhn
    • Not Ranked
    • Joined on 04-23-2008, 12:16 PM
    • Posts 6

    LogParser not returning correct output

    Hi all,

    I am using LogParser to get query the files/directories on my drives.

    I am executing the below code to query my 'C' Drive.

    string pathToScan = @"C:\*.*";
    string tempPath = @"C:\Log.txt";
    string queryString = @"SELECT PATH, SIZE, LASTWRITETIME, ATTRIBUTES, FILEVERSION, COMPANYNAME,PRODUCTNAME,PRODUCTVERSION FROM " + pathToScan + @" TO '" + tempPath + "'";
    COMFileSystemInputContextClassClass inputContext = new COMFileSystemInputContextClassClass();
    COMTSVOutputContextClassClass outputContext = new COMTSVOutputContextClassClass();
    LogQueryClassClass logQuery = new LogQueryClassClass();
    logQuery.maxParseErrors = -2;
    bool success = logQuery.ExecuteBatch(queryString, inputContext, outputContext);

    The results returned by the LogParser will be logged to C:\Log.txt.

    Most of the times the output returned is fine.

    But in some scenarios, I am getting output of which some are invalid.For example, I installed Virtual PC 2007.exe and uninstalled it. Now when I executed the above query, I am getting a wrong file/folder name which is not present on my C drive. If I do the above steps(install/uninstall), i am consistently getting the wrong output.

    The output returned is something like this
    Path Size LastWriteTime Attributes FileVersion CompanyName ProductName ProductVersion


    C:\Win SDPM insx 1.01 micr
    C:\Wi SDPM  1.01

     

    However, on my drive I do not have any file/folder with these names(C:\Win, C:\Wi)

    Since I had installed/uninstalled the application, my guess is the Windows' directory has been modified and hence LogParser is returning the said output. This is just a guess though. 

    I am stuck on this. Any help is appreciated. Is this a known issue/bug with LogParser?

    Thanks

  • 04-23-2008, 5:40 PM In reply to

    • gluegood
    • Top 500 Contributor
    • Joined on 03-16-2008, 8:37 AM
    • Posts 9

    Re: LogParser not returning correct output

    Hi,

    I'd suggest that your FileSystem does contain these files, but they are either corrupt or hidden from view in normal Windows Explorer which has some smarts to hide files from being viewed.  Couple of suggestions.

    1.  Does the same query when run via LogParser.exe return the same results?
    2.  I would then suggest ensuring that Windows Explorer (My Computer) has all the checkboxes checked that allow you to see Protected Operating System files.  Also try to use CMD or COMMAND to dir the files ensuring you show hidden files as well - they are most likely present.
    3.  Run a scandisk on the drive.

    Good luck

    Gluegood

  • 04-24-2008, 3:23 AM In reply to

    • dinhn
    • Not Ranked
    • Joined on 04-23-2008, 12:16 PM
    • Posts 6

    Re: LogParser not returning correct output

    Hi,

    Thanks for the reply.

    gluegood:
    1.  Does the same query when run via LogParser.exe return the same results?
    No. When I run the same query via LogParser.exe I am not getting these results.

    I will look into suggestions 2 & 3 and will update you.

    Thanks 

     

     

  • 04-25-2008, 7:08 AM In reply to

    • dinhn
    • Not Ranked
    • Joined on 04-23-2008, 12:16 PM
    • Posts 6

    Re: LogParser not returning correct output

    Also I found that it returns output like

    C:

    for the query which I had mentioned in my earlier post

    This output seems to be strange.

    Also it returned me the below o/p

    C:\Windows\winsxs\x SDPM roso 1.01 dows

    but I couldn't find this directory(C:\Windows\winsxs\x). I tried the step 2 mentioned by you. But couldn't find the directory.

    Any help?

  • 04-30-2008, 1:47 AM In reply to

    • dinhn
    • Not Ranked
    • Joined on 04-23-2008, 12:16 PM
    • Posts 6

    Re: LogParser not returning correct output

    Hi,

    I am waiting for the solution to my problem. Any help is much appreciated.

    Thanks

Page 1 of 1 (5 items)
Page view counter