Click here to Skip to main content
15,917,060 members
Home / Discussions / C#
   

C#

 
QuestionNHibernate problem with inserting data: error performing isolated work [modified] Pin
dift8-Feb-10 19:33
dift8-Feb-10 19:33 
AnswerRe: NHibernate problem with inserting data: error performing isolated work Pin
dift8-Feb-10 19:50
dift8-Feb-10 19:50 
Questiongetcellbounds() of datagridviewcheckboxcell Pin
prithaa8-Feb-10 19:32
prithaa8-Feb-10 19:32 
Questionshell extention problem on 64 bit PC Pin
Nematjon Rahmanov8-Feb-10 17:38
Nematjon Rahmanov8-Feb-10 17:38 
AnswerDon't point back to a previous post Pin
Not Active8-Feb-10 17:47
mentorNot Active8-Feb-10 17:47 
GeneralRe: Don't point back to a previous post Pin
Nematjon Rahmanov8-Feb-10 19:11
Nematjon Rahmanov8-Feb-10 19:11 
AnswerRe: shell extention problem on 64 bit PC Pin
Dave Kreskowiak9-Feb-10 2:30
mveDave Kreskowiak9-Feb-10 2:30 
Questioncommand.exe double quoted arguments Pin
stmweb8-Feb-10 15:27
stmweb8-Feb-10 15:27 
I'm currently writing a wrapper for Fossil (www.fossil-scm.org[^]).

I'm trying to pass two double quoted arguments to cmd.exe, but there seems to be a problem with my command and I can't find what's wrong with it.

here's a snippet of my code:

var proc = new Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = "cmd.exe";
proc.StartInfo.Arguments = "/c " + Command;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
proc.StartInfo.CreateNoWindow = true;
Debug.WriteLine(proc.StartInfo.Arguments);
proc.Start();

Output = proc.StandardOutput.ReadToEnd();



Here are my cases:

======
1
proc.StartInfo.Arguments: "/c \"C:\\Documents and Settings\\Simon\\Bureau\\Fossil\\fossil.exe\" new \"C:\\Documents and Settings\\Simon\\Bureau\\test1\""

Debug.WriteLine: /c "C:\Documents and Settings\Simon\Bureau\Fossil\fossil.exe" new "C:\Documents and Settings\Simon\Bureau\test1"

Output: "" (doesn't work in my project, but using the same command directly in cmd.exe does work. I don't understand why.)

======
2
proc.StartInfo.Arguments: "/c \"C:\\Documents and Settings\\Simon\\Bureau\\Fossil\\fossil.exe\" new C:\\hello\\testing\\test1"

Debug.WriteLine: /c "C:\Documents and Settings\Simon\Bureau\Fossil\fossil.exe" new C:\hello\testing\test1

Output: *works as expected*
======

There seems to be a problem with my second double quoted string, but I don't understand why.

I would be really grateful if anybody could help me on this. I plan to offer this project to the community and it is pretty much my main problem currently.

Thanks a lot.


If it might help: I'm developing with VS.Net 2008 SP1 in C# with the .Net 3.5 Framework.

(I did try looking for answers in the forum, google and other sources, but couldn't find an answer for it.)
AnswerRe: command.exe double quoted arguments Pin
Luc Pattyn8-Feb-10 16:14
sitebuilderLuc Pattyn8-Feb-10 16:14 
GeneralRe: command.exe double quoted arguments Pin
stmweb8-Feb-10 17:11
stmweb8-Feb-10 17:11 
GeneralRe: command.exe double quoted arguments Pin
Luc Pattyn8-Feb-10 23:47
sitebuilderLuc Pattyn8-Feb-10 23:47 
Questionhow would i filter results on my bindingnavigator when using a stored procedure call with linq? Pin
tonyonlinux8-Feb-10 14:54
tonyonlinux8-Feb-10 14:54 
AnswerRe: how would i filter results on my bindingnavigator when using a stored procedure call with linq? Pin
tonyonlinux9-Feb-10 15:37
tonyonlinux9-Feb-10 15:37 
GeneralRe: how would i filter results on my bindingnavigator when using a stored procedure call with linq? Pin
tonyonlinux9-Feb-10 16:53
tonyonlinux9-Feb-10 16:53 
QuestionCorrect technique for implementating a modal loop Pin
Jim Crafton8-Feb-10 9:00
Jim Crafton8-Feb-10 9:00 
AnswerRe: Correct technique for implementating a modal loop [modified] Pin
Luc Pattyn8-Feb-10 9:13
sitebuilderLuc Pattyn8-Feb-10 9:13 
Questiondatagridcheckbox in a datagrid Pin
prithaa8-Feb-10 7:06
prithaa8-Feb-10 7:06 
AnswerRe: datagridcheckbox in a datagrid Pin
OriginalGriff8-Feb-10 8:27
mveOriginalGriff8-Feb-10 8:27 
GeneralRe: datagridcheckbox in a datagrid Pin
prithaa8-Feb-10 17:30
prithaa8-Feb-10 17:30 
QuestionSure this has been asked before but can not find answer (c# prototypes) Pin
Andy Braham8-Feb-10 6:16
Andy Braham8-Feb-10 6:16 
AnswerRe: Sure this has been asked before but can not find answer (c# prototypes) PinPopular
OriginalGriff8-Feb-10 6:27
mveOriginalGriff8-Feb-10 6:27 
GeneralRe: Sure this has been asked before but can not find answer (c# prototypes) Pin
Andy Braham8-Feb-10 7:21
Andy Braham8-Feb-10 7:21 
GeneralRe: Sure this has been asked before but can not find answer (c# prototypes) Pin
Dave Kreskowiak8-Feb-10 7:25
mveDave Kreskowiak8-Feb-10 7:25 
GeneralRe: Sure this has been asked before but can not find answer (c# prototypes) Pin
harold aptroot8-Feb-10 7:40
harold aptroot8-Feb-10 7:40 
GeneralRe: Sure this has been asked before but can not find answer (c# prototypes) Pin
DaveyM698-Feb-10 8:03
professionalDaveyM698-Feb-10 8:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.