"MoveDirectory" is moving CONTENTS of folder not the folder itself. Is this normal?

  • Thread starter Thread starter Mugsy_in_Houston
  • Start date Start date
M

Mugsy_in_Houston

Guest
I'm trying to move a folder from one location to another using the following command, but when I do, it moves only the contents of the folder, not the folder itself.

Is this normal behavior? I can easily recreate the folder at the target location, but why add an unnecessary step if I don't have to?

For Each strSrcFolder As String In IO.Directory.GetDirectories("C:\MyData\Temp")
My.Computer.FileSystem.MoveDirectory(strSrcFolder, strDestPath & "\Data\")
Next
.
The result is all of the files inside the source folder are moved and placed loose in the destination folder. Very annoying.


PS: I've tried other methods than "My.Computer".

Continue reading...
 
Back
Top