I have 2 folders:

m:\folder1

and

m:\folder2

I would like to merge folder2 with folder1 so that only folder1 exists.

I tried using SHFileOperation

With SHFileOp
    .wFunc = FO_FUNC
    .pFrom = "m:\folder2"
    .pTo = "m:\folder1"
    .fFlags = FO_MOVE
End With

...but that put m:\folder2 into m:\folder1\folder2. But that was not what I wanted.

Is SHFileOperation the valid approach to do that and if yes, how should that be done?

Thank you!

有帮助吗?

解决方案

To move all the files in the folder, you need:

.pFrom = "m:\folder2\*.*"
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top