Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Running an external program

Running an external program

Scheduled Pinned Locked Moved C#
questioncsharp
4 Posts 2 Posters 26 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tariq
    wrote on last edited by
    #1

    Hello, How can i get a bit of C# code to launch an external program (for instance notepad) ? Regards, Tariq

    A 1 Reply Last reply
    0
    • T Tariq

      Hello, How can i get a bit of C# code to launch an external program (for instance notepad) ? Regards, Tariq

      A Offline
      A Offline
      Andreas Philipson
      wrote on last edited by
      #2

      System.Diagnostics.Process.Start ("notepad.exe");

      Check out the documentation on the System.Diagnostics.Process class for more info... Andreas Philipson

      T 1 Reply Last reply
      0
      • A Andreas Philipson

        System.Diagnostics.Process.Start ("notepad.exe");

        Check out the documentation on the System.Diagnostics.Process class for more info... Andreas Philipson

        T Offline
        T Offline
        Tariq
        wrote on last edited by
        #3

        Thanks for the information. Appreciate it:) But I still have one doubt. That is, how do i pass parameters to the application I am trying to run. eg . notepad test1.txt I tried giving it in the file name - but that doesnt work. I couldnt find any other relevant property to achieve this. Can you help? Regards, Tariq

        A 1 Reply Last reply
        0
        • T Tariq

          Thanks for the information. Appreciate it:) But I still have one doubt. That is, how do i pass parameters to the application I am trying to run. eg . notepad test1.txt I tried giving it in the file name - but that doesnt work. I couldnt find any other relevant property to achieve this. Can you help? Regards, Tariq

          A Offline
          A Offline
          Andreas Philipson
          wrote on last edited by
          #4

          using System.Diagnostics;

          ProcessStartInfo notepad = new ProcessStartInfo ("notepad.exe", "C:\\SomeFile.txt");
          Process.Start (notepad);

          :) Andreas Philipson

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups