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. How to pass attributes to an exe??

How to pass attributes to an exe??

Scheduled Pinned Locked Moved C#
tutorialquestion
4 Posts 4 Posters 0 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.
  • N Offline
    N Offline
    Neha_Gupta
    wrote on last edited by
    #1

    Hi All, I have 2 exe's.What I have to do is to call one exe from the second one with some arguments.How to do it??

    NEHA GUPTA

    A S M 3 Replies Last reply
    0
    • N Neha_Gupta

      Hi All, I have 2 exe's.What I have to do is to call one exe from the second one with some arguments.How to do it??

      NEHA GUPTA

      A Offline
      A Offline
      althamda
      wrote on last edited by
      #2

      Use Process, you can add arguments by using Process.StartInfo.Arguments http://www.codeproject.com/csharp/start_an_external_app.asp[^]

      1 Reply Last reply
      0
      • N Neha_Gupta

        Hi All, I have 2 exe's.What I have to do is to call one exe from the second one with some arguments.How to do it??

        NEHA GUPTA

        S Offline
        S Offline
        Stefan Troschuetz
        wrote on last edited by
        #3

        Take a look at the Process.Start method.


        "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

        www.troschuetz.de

        1 Reply Last reply
        0
        • N Neha_Gupta

          Hi All, I have 2 exe's.What I have to do is to call one exe from the second one with some arguments.How to do it??

          NEHA GUPTA

          M Offline
          M Offline
          Martin 0
          wrote on last edited by
          #4

          Hello, In the namespace System.Diagnostics you will find Process and ProcessStartInfo.

          ProcessStartInfo psi= new ProcessStartInfo();
          psi.UseShellExecute = false; //look at the discription if you need it!
          psi.FileName = ???;//exe file name
          psi.WorkingDirectory = ???;//path to the exe
          psi.Arguments = @"xxx"; //set the arguments you whant (for more than one you have to separate with " ")
          using(Process YourProcess= Process.Start(psi))
          {
          YourProcess.???; //Here you can do stuff with the process if you have to.
          }

          All the best, Martin

          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