简体   繁体   English

在 C# 中运行卸载字符串的最佳方法

[英]Best way to run uninstall string in C#

I have a code that gets the uninstall string and will need to run it to uninstall a program.我有一个获取卸载字符串的代码,需要运行它来卸载程序。 Will add arguments to it as well.还将向其中添加 arguments。

Here's an example uninstall string that I will need to run这是我需要运行的示例卸载字符串

MsiExec.exe /X{002EBFA7-9438-34EA-8BB9-8445758AFE27} /qn /passive /norestart

Looking for the most recommended way to convert this to C# code.寻找将其转换为 C# 代码的最推荐方法。

         var proc = new Process
         {
             StartInfo =
             {
                 FileName = @"msiexec",                        
                 WorkingDirectory = @"C:\wherever",
                 Arguments = @"/qn /passive /norestart"
             }
         }.Start();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM