What's the best way to resolve a filepath?

Posted by BillyONeal on Stack Overflow See other posts from Stack Overflow or by BillyONeal
Published on 2010-03-21T23:17:58Z Indexed on 2010/03/21 23:21 UTC
Read the original article Hit count: 477

Filed under:
|
|

Hello everyone :)

I've got a series of filepaths that look something like this:

  • C:\Windows\System32\svchost.exe -k LocalSystemNetworkRestricted
  • C:\Windows\System32\svchost
  • C:\Program Files (x86)\Common Files\Steam\SteamService.exe /RunAsService
  • "C:\Program Files (x86)\Common Files\Steam\SteamService.exe" /RunAsService

and I need to find these paths' actual locations. So, respectively, the above would be:

  • C:\Windows\System32\svchost.exe
  • C:\Windows\System32\svchost.exe
  • C:\Program Files (x86)\Common Files\Steam\SteamService.exe
  • C:\Program Files (x86)\Common Files\Steam\SteamService.exe

What's the best way to go about doing this? Does windows have an API function to accomplish it? I essentially am trying to figure out what executable CreateProcess will call if I pass it that path.

Thanks!

Billy3

© Stack Overflow or respective owner

Related posts about c++

Related posts about Windows