0

For starters, I'm quite new to C#.

How would I go about checking if a (.exe) file exists anywhere on a pc's memory? I tried to google an answer, but only ones I came across required you to specify a directory where to look from.

I'm building an application that launches certain apps which the user selects, hence why I can't know the directory where the file is in. Is there a way of checking it without a directory, aka check if the file exists anywhere on the pc?

Alternatively, is there a way to handle an error where the selected file is not found?

Zecuel
  • 25
  • 8
  • Do the "certain apps" you want to check for happen to have well-defined registry entries for their locations? If so, looking in the registry will be somewhat faster than searching the file system. – Andrew Morton Apr 07 '18 at 18:05
  • The programs I'll be running can be literally anything so I'd assume they all won't have registry entries? (I want the program to be able to launch literally any .exe application the user defines) – Zecuel Apr 08 '18 at 07:54

0 Answers0