Process Walking - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Process Walking

How can I get the full path of the exe filenames ?
The szExeName property of PROCESSENTRY32 doesn't really show the full path but only the filename.

Comments

  • zibadianzibadian Posts: 6,349Member
    : How can I get the full path of the exe filenames ?
    : The szExeName property of PROCESSENTRY32 doesn't really show the full path but only the filename.
    :
    :
    One way to get the full path is to use a iterative directory-tree-walk search using FindFirst(), FindNext(), and FindClose(). That's easy to code, but quite processor-heavy.
  • SeriSeri Posts: 28Member
    : : How can I get the full path of the exe filenames ?
    : : The szExeName property of PROCESSENTRY32 doesn't really show the full path but only the filename.
    : :
    : :
    : One way to get the full path is to use a iterative directory-tree-walk search using FindFirst(), FindNext(), and FindClose(). That's easy to code, but quite processor-heavy.
    :
    Yep it is far too heavy I think, is there any other way ?
  • erikkdrerikkdr Posts: 5Member
    : How can I get the full path of the exe filenames ?
    : The szExeName property of PROCESSENTRY32 doesn't really show the full path but only the filename.
    :
    :
    Hello!

    You can use following rows to extract it.

    var path: String;
    begin
    path := ExtractFilePath(application.Exname);
    end;


  • zibadianzibadian Posts: 6,349Member
    : : How can I get the full path of the exe filenames ?
    : : The szExeName property of PROCESSENTRY32 doesn't really show the full path but only the filename.
    : :
    : :
    : Hello!
    :
    : You can use following rows to extract it.
    :
    : var path: String;
    : begin
    : path := ExtractFilePath(application.Exname);
    : end;
    :
    :
    :
    That code does not give the path of the szExeName property, but only the path of the application, which is not necessarily the same application in the PROCESSENTRY32 record.
  • zibadianzibadian Posts: 6,349Member
    : : : How can I get the full path of the exe filenames ?
    : : : The szExeName property of PROCESSENTRY32 doesn't really show the full path but only the filename.
    : : :
    : : :
    : : One way to get the full path is to use a iterative directory-tree-walk search using FindFirst(), FindNext(), and FindClose(). That's easy to code, but quite processor-heavy.
    : :
    : Yep it is far too heavy I think, is there any other way ?
    :
    You can try the ExpandFilePath().
Sign In or Register to comment.