List Info

Thread: System.Diagnostics.Process "access is denied" with arguments




System.Diagnostics.Process "access is denied" with arguments
user name
2006-10-13 18:26:12
I'm trying to launch another application from my c# code
using
System.Diagnostics.Process.  I can launch the .exe file just
fine.  But
I want to pass it an xml file as a command line argument. 
It works
fine from the command prompt, but when I try to add the
argument to the
call in my code I get an "access is denied"
exception.  Why would it
work in the command line, but not in my app?

System.Diagnostics.Process thisguy = new
System.Diagnostics.Process();
thisguy.StartInfo.FileName = "C:\Program
Files\myApp\myApp.exe";
thisguy.StartInfo.Arguments = "[- xml string -]"
*sensitive information
thisguy.Start();

the xml string is very long, but again it works in the
command prompt.

Any help would be appreciated.

Kevin J


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C# Developers" group.
To post to this group, send email to CSDevelopersgooglegroups.com
To unsubscribe from this group, send email to
CSDevelopers-unsubscribegooglegroups.com
For more options, visit this group at http
://groups-beta.google.com/group/CSDevelopers
-~----------~----~----~----~------~----~------~--~---

System.Diagnostics.Process "access is denied" with arguments
user name
2006-10-13 19:40:18
well, it turns out that the system.startinfo.arguments is
limited to
2000 some characters, and my xml string was longer than
that.  To work
around this, I had to save the xml to a file, and pass the
path as my
parameter.  Not what I wanted to do, but whatever.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C# Developers" group.
To post to this group, send email to CSDevelopersgooglegroups.com
To unsubscribe from this group, send email to
CSDevelopers-unsubscribegooglegroups.com
For more options, visit this group at http
://groups-beta.google.com/group/CSDevelopers
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )