• Log in or sign up for an account here: https://www.sythe.org/login

Need help starting CMD commands in C#...

Cymru

Apprentice
Banned
Joined
Jan 22, 2007
Sythe Gold
0
Messages
693
Location
Down that alley...
Need help starting CMD commands in C#...
I've been looking for a guide or something that will show me the steps to getting this to work.

I know there is something to do with System.Diagnostics.processstartifo
or something...

If someone can just show me a way to start a simple command like dir by pressing a button on my form. Thanks.

EDIT: I found out how to do it:

you needed to have startinfo.FileName for the cmd and startinfo.Arguments for the commands.
 
Need help starting CMD commands in C#...
An easier way would be:

Code:
System.Diagnostics.Process.Start("<command>");
 
Need help starting CMD commands in C#...
Yes, but I think that has a different affect (possibly). Can you still give arguments for it?

And it seems to be the same length code, so it doesn't matter.
 
Need help starting CMD commands in C#...
Yes, but I think that has a different affect (possibly). Can you still give arguments for it?

And it seems to be the same length code, so it doesn't matter.
Command line arguments simply follow after the command in question.

e.g.

Code:
Process.Start("notepad C:\test.txt");
 
Need help starting CMD commands in C#...
An easier way would be:

Code:
System.Diagnostics.Process.Start("<command>");
you can't execute commands like 'dir' using that method. Those are built into cmd.exe.
 
Runescape Gamblingrunescape gambling
Back
Top