开发者

How to run uninstall.exe using .Net

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜