On Sat, 2006-06-24 at 15:06 -0400, Lee wrote:
> Can someone provide a sample of calling an external application from within
> a C# app?
> 
> I've tried a vew simple things like:
> 
> System.Diagnostics.Process.Start("shutdown -r now");

This will only work for programs which are in your $PATH, and `shutdown'
usually isn't in the normal path (it's in /sbin, and */s* directories
are usually omitted from $PATH because they're for use by sysadmins).

Try using the full path, e.g.

        System.Diagnostics.Process.Start ("/sbin/shutdown -r now");

Also, your program will likely need to be running as `root' in order for
the `shutdown' invocation to actually do anything...

 - Jon


_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to