954,479 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Trouble Using Command Line Argument

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

CreateProcess ( "C:\\abc.exe", " C:\\Documents and Settings\\xyz.exe 2", NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS,
                 NULL, NULL, &si, &pi );


but due to spaces b/wDocuments 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???

keyser_soze
Newbie Poster
9 posts since Oct 2008
Reputation Points: 25
Solved Threads: 3
 
CreateProcess ( "C:\\abc.exe", " \"C:\\Documents and Settings\\xyz.exe\" 2", NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS,
                 NULL, NULL, &si, &pi );

Some well-placed \" perhaps?

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You