Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

move files from one directory to another using c#

using System.IO;

string rootDirectory = @"C:UsersUSERFolder1";
string destinationDirectory = @"C:UsersUSERFolder2";

string[] Files = Directory.GetFiles(rootDirectory);

foreach (string file in Files) {
	File.Move(file, $"{destinationDirectory}{Path.GetFileName(file)}");
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #move #files #directory
ADD COMMENT
Topic
Name
4+9 =