[Mono-list] command
Fabian
fseoane@wanadoo.es
Mon, 09 Aug 2004 15:15:13 +0200
--=-oDiGK8iAjJuy2YIjMhJ6
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi!. If i'm not wrong, if i want to execute a shell command like "ls
-lh" I must paste the following code:
System.Diagnostics.Process proc = new
System.Diagnostics.Process();
proc.EnableRaisingEvents=false;
proc.StartInfo.FileName= "ls";
proc.StartInfo.Arguments = "-lh";
proc.Start();
proc.WaitForExit();
The problem is that it doesen't work unless i'm root. Otherwise I get:
Unhandled Exception: System.ComponentModel.Win32Exception: Cannot find
the specified file
in <0x00657> System.Diagnostics.Process:Start_common
(System.Diagnostics.ProcessStartInfo,System.Diagnostics.Process)
in <0x0003d> System.Diagnostics.Process:Start
(System.Diagnostics.ProcessStartInfo)
in <0x00029> System.Diagnostics.Process:Start (string)
in <0x0000f> prueba:Main ()
Is there a way to execute a shell command without being root ?
Thanks.
--=-oDiGK8iAjJuy2YIjMhJ6
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.0.9">
</HEAD>
<BODY>
Hi!. If i'm not wrong, if i want to execute a shell command like "ls -lh" I must paste the following code: <BR>
<BR>
System.Diagnostics.Process proc = new System.Diagnostics.Process(); <BR>
proc.EnableRaisingEvents=false;<BR>
proc.StartInfo.FileName= "ls"; <BR>
proc.StartInfo.Arguments = "-lh"; <BR>
proc.Start(); <BR>
proc.WaitForExit(); <BR>
<BR>
The problem is that it doesen't work unless i'm root. Otherwise I get: <BR>
<BR>
Unhandled Exception: System.ComponentModel.Win32Exception: Cannot find the specified file<BR>
in <0x00657> System.Diagnostics.Process:Start_common (System.Diagnostics.ProcessStartInfo,System.Diagnostics.Process)<BR>
in <0x0003d> System.Diagnostics.Process:Start (System.Diagnostics.ProcessStartInfo)<BR>
in <0x00029> System.Diagnostics.Process:Start (string)<BR>
in <0x0000f> prueba:Main ()<BR>
<BR>
<BR>
Is there a way to execute a shell command without being root ?<BR>
Thanks.
</BODY>
</HTML>
--=-oDiGK8iAjJuy2YIjMhJ6--