Skip to content

Move all sub directories and files

julian.haines

Asked Nov 16, 2006, 6:18 AM EST1 answer
Share
LinkedInX
Hi, I am trying to write a very simple C# console application that will move all files and directories under a certain directory to another computer, for example FROM C:\Directory\move all files and directories here TO \\OtherPC\C$\FILES_MOVED\ I have tried Directory.Move(@"C:\FROMHERE\*.*", @"\OTHERPC\C$\TOHERE\"); But it does not like the *.* for all directories and files Can anyone help me Thanks Joolz

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Mahesh Chand
    0
    You may have to read all files and sub directories in a directory and move them one by one. I beleive directory with one level moves just fine. Problem is when you have multiple levels.
    0