I want to scan and get all the Application files in my computer.
I know how to get them, but I want only the applications which are Executable (except for Installers).
Basically, what I want is the same function steam uses.
Example:
I want to scan and get all the Application files in my computer.
I know how to get them, but I want only the applications which are Executable (except for Installers).
Basically, what I want is the same function steam uses.
Example:
You can use this code to find all exes recursively in a directory
DirectoryInfo dirInfo = new DirectoryInfo(@"C:\Program Files");
var exeFiles = dirInfo.EnumerateFiles("*.exe", SearchOption.AllDirectories);
foreach ( var exeFile in exeFiles )
{
Console.WriteLine( exeFile );
}
Depending on you definition of executable you might have to also do *.com
, *.bat
etc etc. There is no way to distinguish between an installer exe vs regular exe file though. You might have to apply some heuristics
If you want to get the list of installed applications on your system, you can query the registry. Refer to Get installed applications in a system for an example.