Process DYProcess = new Process();
DYProcess.StartInfo.FileName = @"c:\winnt\notepad.exe";
DYProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
ASP.NET is a server application, and everything you code in C#, or any other .NET language, is executed on the server-side. Therefore, opening a Notepad application is just weird, to say the least. Do you expect some administrator to be sitting in front of the server waiting for a Windows application to open up in response to a user's request for a page? Being a server application, the ASP.NET worker process account doesn't even have the permission to open UI elements, because they can cause the process to be kept waiting for user response that may never come. After all, servers shouldn't even be used by end-users regularly; therefore, it's most probable that there is no user session initiated at all.
Set WshShell = CreateObject("WScript.Shell")
You will receive the usual warning about security and ActiveX execution.
This was first published in October 2003