Running program from C# program

Running program from inside a C# program

Page 1 of 1

3 Replies - 1461 Views - Last Post: 23 September 2009 - 05:23 AM Rate Topic: -----

#1 bpinn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 11-October 06

Running program from C# program

Post icon  Posted 21 September 2009 - 03:33 PM

I'm looking for the function call to run in this case "notepad" from inside my C# windows form program. I have the commandline ready, just need the function. Used to use WinExec(cmdline, SW_NORMAL) in C++ and again, I cannot find the C# "version" of this.
Is This A Good Question/Topic? 0
  • +

Replies To: Running program from C# program

#2 gbertoli3  Icon User is offline

  • DIC at Heart + Code
  • member icon

Reputation: 41
  • View blog
  • Posts: 1,162
  • Joined: 23-June 08

Re: Running program from C# program

Posted 21 September 2009 - 03:37 PM

I believe you have to reference the shell32.dll, there should be a function in there somewhere if I remember correctly.
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1658
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Running program from C# program

Posted 21 September 2009 - 03:55 PM

If you're just looking to start Notepad from within your application use the Process Class, no need to use Win32 for this :)
Was This Post Helpful? 0
  • +
  • -

#7 Aspid  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 2
  • Joined: 12-January 09

Re: Running program from C# program

Posted 23 September 2009 - 05:23 AM

using System.Diagnostic
...
Process.Start("Program_Name");
...


Was This Post Helpful? 1

Page 1 of 1