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

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.