468,456 Members | 1,648 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,456 developers. It's quick & easy.

calling external files

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
1 1907
Banfa
9,051 Expert Mod 8TB
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.

Similar topics

4 posts views Thread by Sivakumar Shanmugam | last post: by
16 posts views Thread by teju | last post: by
2 posts views Thread by =?Utf-8?B?YmFzaA==?= | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by subhajit12345 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.