El lun, 09-08-2004 a las 14:57, Jonathan Stowe escribió:
On Mon, 2004-08-09 at 14:15, Fabian wrote:
> 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 ?

Your exact code works fine for me - it is almost something certainly
strange about your system rather than with mono.  What OS are you trying
to run this on?

I'm running Debian Sid.

Thanks for the info, i'll hack a bit to see what's wrong.


/J\

_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to