By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,898 Members | 2,039 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,898 IT Pros & Developers. It's quick & easy.

calling external files

P: 1
Hi its been a few years but i am sure i have done this before. i can easly call the file using

strcpy(Path,"Start.bat");
WinExec(Path,SW_SHOWNORMAL);

but if the path line becomes more complicated it stops because of the extra "" marks.

strcpy(Path,"xcopy "C:\\temp\\temp2.lnk" "C:\\Documents and Settings\\All Users\\Desktop\\" /Y /S /Q /C /K /R /d");
WinExec(Path,SW_SHOWNORMAL);

can someone tell me the way round this.
Jul 11 '06 #1
Share this Question
Share on Google+
1 Reply


Banfa
Expert Mod 5K+
P: 8,916
Easy in the same way that you have escaped \ to \\ inside the string escape " to \"

Expand|Select|Wrap|Line Numbers
  1. strcpy(Path,"xcopy \"C:\\temp\\temp2.lnk\" \"C:\\Documents and Settings\\All Users\\Desktop\\\" /Y /S /Q /C /K /R /d");
  2.  
Jul 11 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.