开发者

How to run uninstall.exe using .Net

开发者 https://www.devze.com 2023-03-29 00:51 出处:网络
I tried lots of things but i can not initiate uninstaller using .net Dim p As New Process Dim uninstallString As String = \"C:\\WINDOWS\\ProCharge Plu开发者_StackOverflow社区gin\\uninstall.exe\" &am

I tried lots of things but i can not initiate uninstaller using .net

    Dim p As New Process
    Dim uninstallString As String = "C:\WINDOWS\ProCharge Plu开发者_StackOverflow社区gin\uninstall.exe" & " /U:C:\Program Files\ProCharge Plugin\irunin.xml"
    p.StartInfo.Arguments = uninstallString           
    p.Start()


You are including the application name as part of the Arguments.

Try the following:

Dim p As New Process
p.StartInfo.Arguments = "/U:""C:\Program Files\ProCharge Plugin\irunin.xml"""
p.Start("C:\WINDOWS\ProCharge Plugin\uninstall.exe")

Where you pass the name of the executable to the Start method.

Another alternative is to use the FileName property:

Dim p As New Process
p.StartInfo.FileName = "C:\WINDOWS\ProCharge Plugin\uninstall.exe"
p.StartInfo.Arguments = "/U:""C:\Program Files\ProCharge Plugin\irunin.xml"""
p.Start()

Check the MSDN page for more information on the various overloads.

0

精彩评论

暂无评论...
验证码 换一张
取 消