Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ShellExecute equivalent in .NET

I'm looking for the .NET-preferred way of performing the same type of thing that ShellExecute does in Win32 (opening, printing, etc. for arbitrary file types).

I've been programming Windows for over 20 years, but I'm a complete newbie at .NET, so maybe I'm just looking in the wrong places. I'm currently using .NET 2.0 (VS C# 2005), but could use VS 2008 if need be.

If the only answer is to use P/Invoke, then I might be better just writing my small utility using Win32 anyway.

like image 252
Martin Kenny Avatar asked Nov 03 '08 11:11

Martin Kenny


1 Answers

Process.Start.

Note that advanced uses (printing etc) require using a ProcessStartInfo and setting the Verb property.

like image 102
Marc Gravell Avatar answered Sep 28 '22 14:09

Marc Gravell