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. Get commandline

Get commandline

Scheduled Pinned Locked Moved C#
tutorialquestion
7 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.
  • S Offline
    S Offline
    Scalee
    wrote on last edited by
    #1

    How do u get the commandline (arguments) of another process? I example if i use run like so: notepad.exe test.txt I would like my program to return test.txt or whatever the argument might be. Thanks!

    D L S 3 Replies Last reply
    0
    • S Scalee

      How do u get the commandline (arguments) of another process? I example if i use run like so: notepad.exe test.txt I would like my program to return test.txt or whatever the argument might be. Thanks!

      D Offline
      D Offline
      Dave Herren
      wrote on last edited by
      #2

      So far as I know this cannot be done for another process, only for your own program.

      topcoderjax - Remember, Google is your friend. Try this Custom Google Code Search

      1 Reply Last reply
      0
      • S Scalee

        How do u get the commandline (arguments) of another process? I example if i use run like so: notepad.exe test.txt I would like my program to return test.txt or whatever the argument might be. Thanks!

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Hi, it must be possible, utilities such as TaskInfo do it, but I dont know how... :)

        Luc Pattyn [My Articles] [Forum Guidelines]

        1 Reply Last reply
        0
        • S Scalee

          How do u get the commandline (arguments) of another process? I example if i use run like so: notepad.exe test.txt I would like my program to return test.txt or whatever the argument might be. Thanks!

          S Offline
          S Offline
          Scalee
          wrote on last edited by
          #4

          Yup process explorer as well but i cant find any info on howto :S

          L 1 Reply Last reply
          0
          • S Scalee

            Yup process explorer as well but i cant find any info on howto :S

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            Found it: - see Process class - use whatever static methods there you need to get to the right Process - then look at theProcess.StartInfo.Arguments :)

            Luc Pattyn [My Articles] [Forum Guidelines]

            S 1 Reply Last reply
            0
            • L Luc Pattyn

              Found it: - see Process class - use whatever static methods there you need to get to the right Process - then look at theProcess.StartInfo.Arguments :)

              Luc Pattyn [My Articles] [Forum Guidelines]

              S Offline
              S Offline
              Scalee
              wrote on last edited by
              #6

              Somebody already said that and it doesnt work.

              L 1 Reply Last reply
              0
              • S Scalee

                Somebody already said that and it doesnt work.

                L Offline
                L Offline
                Luc Pattyn
                wrote on last edited by
                #7

                it works for me. if you want more help, show your code and results. :)

                Luc Pattyn [My Articles] [Forum Guidelines]

                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