Trouble Using Command Line Argument

Thread Solved

Join Date: Oct 2008
Posts: 9
Reputation: keyser_soze is an unknown quantity at this point 
Solved Threads: 3
keyser_soze's Avatar
keyser_soze keyser_soze is offline Offline
Newbie Poster

Trouble Using Command Line Argument

 
0
  #1
Jan 17th, 2009
i have been using CreatProcess in my program to initialize another program with two command line arguments as
C:\\Documents and Settings\\xyz.exe
and 2

so the code i am using is
  1. CreateProcess ( "C:\\abc.exe", " C:\\Documents and Settings\\xyz.exe 2", NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS,
  2. NULL, NULL, &si, &pi );

but due to spaces b/w Documents and settings it is treating it as 3 arguments.....is there a way to pass arguments with spaces and still
treat them as a single argument???
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Trouble Using Command Line Argument

 
0
  #2
Jan 17th, 2009
  1. CreateProcess ( "C:\\abc.exe", " \"C:\\Documents and Settings\\xyz.exe\" 2", NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS,
  2. NULL, NULL, &si, &pi );
Some well-placed \" perhaps?
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC