How can I create a directory in
c:/’Program Files’/blablabla
using c++?
I also want to copy some files in blablabla folder. For example, test.exe, how do I implement this in c++ language?
Also, how to make shortcut in desktop to connect with test.exe in blabla folder.
I’m using devc++ version 4.9.9.2 and windows 7, can someone help me? Thanks for ur help.
edit:
i got this code
fstream f("FILE.EXTENSION", fstream::in|fstream::binary);
f << noskipws;
istream_iterator<unsigned char> begin(f);
istream_iterator<unsigned char> end;
fstream f2("c:\\FILE.EXTENSION",
fstream::out|fstream::trunc|fstream::binary);
ostream_iterator<char> begin2(f2);
copy(begin, end, begin2);
the probleam appear when i’m trying to copy shortcut or folder, can somebody help me?
In native C++ you can’t copy directory, you can copy files (i.e. create new file and copy information from old file to new file), but without using non-standard libs you cannot create directory. You can look to
WINApifor this or toboost.For create directory and copy files use for example boost::filesystem, or some
OS-dependentAPI.Example of create dir: