Search code examples
vb.net.net-core.net-6.0

.NET 6: Process.Start("powerpnt.exe") doesn't work anymore


With Visual Basic .NET and .NET 6, Process.Start("powerpnt.exe") doesn't work anymore. What is the new way of calling up other apps now without having to call the entire path to the exe?


Solution

  • You need to use a ProcessStartInfo object and set UseShellExecute to True:

    Dim psi As New ProcessStartInfo
    
    With psi
        .FileName = "powerpnt.exe"
        .UseShellExecute = True
    End With
    
    System.Diagnostics.Process.Start(psi)
    

    With .NET 6, UseShellExecute is False by default (it was True by default in the .NET Framework).