[Gtk-sharp-list] Executing Shell commands

Zaizeku zaizeku at gmail.com
Sat Jun 6 14:06:15 EDT 2009


Hey Guys I'm fairly new using C# on linux and well I'm having some trouble
trying to execute a shell command from the code, I tried doing it the way I
did it in C and C++ but to no avail, found some tutorials and guides on how
to execute shell commands on C# but what I can only do is execute a program,
what I really want to do is be able to execute a command like for example:

rm -r <Directory>

and well I'm not having any luck, here is what I have right now

		System.Diagnostics.Process pipes = new System.Diagnostics.Process();
		pipes.EnableRaisingEvents = false;
		
		pipes.StartInfo.FileName = "gnome-terminal";
		//pipes.StartInfo.Arguments = "rm -r /home/zaizeku/Desktop/test.txt";
		pipes.Start();

this does execute the terminal but the argument which I think would be the
command is never even written/executed at all, I first tried just plainly
doing this
	      
              System.Diagnostics.Process pipes = new
System.Diagnostics.Process();
	      pipes.EnableRaisingEvents = false;
              pipes.StartInfo.FileName = "rm -r
/home/zaizeku/Desktop/test.txt";
              pipes.Start();

but it did not do anything, I'm really having a hard time finding a solution
to this, so I ask you guys, can you help me figure this out, or tell me if
its not possible.

Thanks in Advance




-- 
View this message in context: http://www.nabble.com/Executing-Shell-commands-tp23904222p23904222.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.



More information about the Gtk-sharp-list mailing list