LoginSignup
6
7

More than 5 years have passed since last update.

「プログラムと機能」の一覧を取得する

Posted at

プログラムから「プログラムと機能」の一覧を取得する方法。
コマンドラインの「reg query」を使用する。

C#
var p = new System.Diagnostics.Process();
p.StartInfo.FileName = string.Format("{0}\\cmd.exe", Environment.GetFolderPath(Environment.SpecialFolder.System));
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardInput = false;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.Arguments = " /c reg query \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\" /s | findstr \"\\<DisplayName\"";
p.Start();

// コマンドの結果を受け取る
string programListInfo = p.StandardOutput.ReadToEnd();


6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7