On Windows is there an interface for Copying Folders?

前端 未结 7 569
陌清茗
陌清茗 2021-01-18 06:41

I want to copy folder A and paste to desktop.

I am currently using C++ so preferably an OO interface if available.

7条回答
  •  执念已碎
    2021-01-18 07:17

    Here's an example using SHFileOperation:

    http://msdn.microsoft.com/en-us/library/bb776887%28VS.85%29.aspx#example

    Here's a quick hack without it:

    #import 
    
    int main(int argc, char *argv[]) {
    
        system("robocopy \"C:\\my\\folder\" \"%userprofile%\\desktop\\\" /MIR");
        return 0;
    }
    

提交回复
热议问题