-
March 10th, 2006, 08:28 AM
#1
using the command prompt in c#
Hi,
In C++ there is a function called System(...) that you can call to run a command from a dos prompt while running your application. Is there a similar function in C#?
Thanks
-
March 10th, 2006, 08:47 AM
#2
Re: using the command prompt in c#
Originally Posted by mps2
Hi,
In C++ there is a function called System(...) that you can call to run a command from a dos prompt while running your application. Is there a similar function in C#?
Thanks
What do you want to do. There are multiple ways, if you just want to write something to the console then you can use Console Class or if you want to start a new command prmpt, you can use Process class.
-
March 10th, 2006, 08:59 AM
#3
Re: using the command prompt in c#
I want to call an exe and pass it a string as command line args
-
March 10th, 2006, 09:06 AM
#4
Re: using the command prompt in c#
Originally Posted by mps2
I want to call an exe and pass it a string as command line args
An easy way would be to use Process Class.
Code:
System.Diagnostics.Process.Start("Path&NameOfEXEfile", ParameterToBePassed);
Remember you will have to pass the complete path of the exe file and the second parameter is the commandline parameter that you want to pass.
-
March 10th, 2006, 03:30 PM
#5
Re: using the command prompt in c#
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|