Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

path question...

Status
Not open for further replies.

hughLg

Programmer
Feb 18, 2002
136
MY
This is a question about the expression of path...

We know that the function "system(char *s)" is used to run the Operating System command. In many times, we have to specify the particular path for the file as the argument when run specific command (or called program).

We know that path (that has space in middle) provided in DOS prompt has to be surround by 2 double quotes. I have no this problem when provide such path in DOS prompt. But when I want to give this:

"c:\program files\bcc55\bin\bcc32.exe" "C:\My Documents\Implementation\Practices\test.c"

command (which has no problem in DOS prompt) in my program like this:

system("\"c:\\program files\\bcc35\\bin\\bcc32.exe\" \"C:\\My Documents\\Implementation\\Practices\\test.c\"");

This problem prevents me from run specific executable program within my program...
 
Use the short filename version of the path elements, as provided to you by the "dir /x" command.

Something like
system("c:\\progra~1\\bcc35\\bin\\bcc32.exe C:\\My Docu~1\\Implementation\\Practices\\test.c"); ______________________________________________________________________
Perfection in engineering does not happen when there is nothing more to add.
Rather it happens when there is nothing more to take away.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top