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. Command Line Arguments for an existing process

Command Line Arguments for an existing process

Scheduled Pinned Locked Moved C#
tutorialquestion
4 Posts 3 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.
  • G Offline
    G Offline
    Guinness4Strength
    wrote on last edited by
    #1

    Does anyone know how to retreive the command line arguments for an existing external process ? StartInfo.Arguments does not contain it.

    N A 2 Replies Last reply
    0
    • G Guinness4Strength

      Does anyone know how to retreive the command line arguments for an existing external process ? StartInfo.Arguments does not contain it.

      N Offline
      N Offline
      Nader Elshehabi
      wrote on last edited by
      #2

      Hello Why, I wonder?? Arguments should be in that property!! Try using the ProcessStartInfo.Verbs property instead.

      Regards:rose:

      A 1 Reply Last reply
      0
      • G Guinness4Strength

        Does anyone know how to retreive the command line arguments for an existing external process ? StartInfo.Arguments does not contain it.

        A Offline
        A Offline
        Arjun Mjolnir Bahree
        wrote on last edited by
        #3

        Well do i assume that the external process is a managed app? Anyways, any process started with command line arguments, has them stored in the process primary stack, since they are in scope of the entry point. You need to write a generic unmanaged code piece to access the string array passed into the entry point by the c runtime in an unmanaged process. For a managed app you need to get the pointer location of the entrypoint and then in contigous to the it would be the command line arguments passed in. you can see where the arguments finish by wrapping your search before any instruction address or jmp instruction appears. Does that make something clear here?

        Excelsior Arjun Bahree "By The Might of Mjolnir" I Came! I Coded! I Conquered!

        1 Reply Last reply
        0
        • N Nader Elshehabi

          Hello Why, I wonder?? Arguments should be in that property!! Try using the ProcessStartInfo.Verbs property instead.

          Regards:rose:

          A Offline
          A Offline
          Arjun Mjolnir Bahree
          wrote on last edited by
          #4

          Verbs does not contain any command line args at all. It purpose of use is very different. it indicates the actions that the system can apply to the file indicated by the FileName property of ProcessStartInfo class.

          Excelsior Arjun Bahree "By The Might of Mjolnir" I Came! I Coded! I Conquered!

          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