Sunday, July 26, 2009

How can I make my application copy an .exe into a folder?

Im using Microsft Visual C++ 2005 Express Edition and I would like to know how I can make one application copy a previously made .exe application into a folder (e.g. C:/Program Files/MSN Messenger/)


Can I do this and if so how, please give code or a direct link to a relevant page and not a whole website.

How can I make my application copy an .exe into a folder?
look for "system" in the VC++ help:





#include %26lt;process.h%26gt;





void main( void )


{


system( "cp c:\filename.txt c:\somewhere\filename.txt" );


}








this uses DOS style commands, in this case "cp" for copy etc...you will need to look up other DOS command prompt commands for other shell activity using system()


No comments:

Post a Comment