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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How Do I Run A Command Prompt Command?

How Do I Run A Command Prompt Command?

Scheduled Pinned Locked Moved C#
questioncsharpc++
7 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.
  • T Offline
    T Offline
    That Asian Guy
    wrote on last edited by
    #1

    In C++, you do system("command here"); How do you do this in C# without running cmd.exe with an argument? Thanks.

    L 1 Reply Last reply
    0
    • T That Asian Guy

      In C++, you do system("command here"); How do you do this in C# without running cmd.exe with an argument? Thanks.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Process.Start()

      T 1 Reply Last reply
      0
      • L Lost User

        Process.Start()

        T Offline
        T Offline
        That Asian Guy
        wrote on last edited by
        #3

        Process.Start("pause"); gives an error :S.

        L 1 Reply Last reply
        0
        • T That Asian Guy

          Process.Start("pause"); gives an error :S.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          What do you expect it to do?

          C T 2 Replies Last reply
          0
          • L Lost User

            What do you expect it to do?

            C Offline
            C Offline
            Colin Angus Mackay
            wrote on last edited by
            #5

            He expects to run the special commands available in cmd.exe that are not exe files of their own. But he doesn't want to launch cmd.exe itself.

            Developer Day Scotland 2 - Free community conference Recent blog posts: *Throwing Exceptions *Training Developers * Method hiding or overriding - or the difference between new and virtual

            1 Reply Last reply
            0
            • L Lost User

              What do you expect it to do?

              T Offline
              T Offline
              That Asian Guy
              wrote on last edited by
              #6

              Like in unmanaged code when you type that it says "Press any key to continue..." Thats not what I want it to do but its an example. The school has cmd.exe blocked but I need it to run java commands in my program. Thanks.

              D 1 Reply Last reply
              0
              • T That Asian Guy

                Like in unmanaged code when you type that it says "Press any key to continue..." Thats not what I want it to do but its an example. The school has cmd.exe blocked but I need it to run java commands in my program. Thanks.

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                Then run the java vm with the appropriate command line arguments. Using Process.Start is exactly like typing whatever command your want to run in the Start/Run box, not the CMD window.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008

                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