Executing OS Commands via my C# Program

This is a discussion on Executing OS Commands via my C# Program within the C# Programming forums, part of the General Programming Boards category; Hey there I wanna run basic windows command in my c# program (for example- I want to run 'set' , ...

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    24

    Executing OS Commands via my C# Program

    Hey there


    I wanna run basic windows command in my c# program (for example- I want to run 'set' , in order to get a list of all my environment variables. or even run 'dir')

    Please help

    Thanks

    Goz
    And if you get no joy from music hall
    Remember there is always alcohol
    And If you get no joy from Gin
    Here is the abyss jump in

  2. #2
    Registered User
    Join Date
    Jan 2003
    Posts
    648
    Take a look at the System.Diagnostics.Process object in your documentation:
    http://ms-help://MS.VSCC/MS.MSDNVS/c...mberstopic.htm

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    Speedy's solution is fine. However, for the examples you provided there are other functions that can handle what you need. Look for Environment in your help for example.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program Plan
    By Programmer_P in forum C++ Programming
    Replies: 0
    Last Post: 05-11-2009, 02:42 AM
  2. Executing a Program With Arguments
    By HalNineThousand in forum Linux Programming
    Replies: 4
    Last Post: 04-14-2008, 11:09 AM
  3. Executing DOS commands from inside an image
    By Moony in forum C Programming
    Replies: 6
    Last Post: 03-16-2008, 01:40 PM
  4. Executing system commands cross platform
    By markucd in forum C++ Programming
    Replies: 6
    Last Post: 11-04-2005, 08:56 AM
  5. executing another program
    By Jamsan in forum C++ Programming
    Replies: 2
    Last Post: 04-26-2003, 09:22 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21