Hi,
I have am building an uninstall program and can't get the process to stop so that the files can be deleted. I am using code that I copied from a sample and it works fine with any process as long as there is no space in the name.


works

Dim process As System.Diagnostics.Process = Nothing
        Dim psi As New ProcessStartInfo
        psi.UseShellExecute = True
        psi.FileName = "taskkill.exe"
        psi.Arguments = "/F /IM notepad.exe"
        process = System.Diagnostics.Process.Start(psi)

doesn't work

Dim process As System.Diagnostics.Process = Nothing
        Dim psi As New ProcessStartInfo

        psi.UseShellExecute = True
        psi.FileName = "taskkill.exe"
        psi.Arguments = "/F /IM movie sleuth.exe"
        process = System.Diagnostics.Process.Start(psi)

Thanks in advance

Recommended Answers

try this:

psi.Arguments = String.Format("/F /IM {0}movie sleuth.exe{0}", Chr(34))
Jump to Post

All 2 Replies

try this:

psi.Arguments = String.Format("/F /IM {0}movie sleuth.exe{0}", Chr(34))

Thanks a lot GeekByChoiCe
that works beautiful!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.