• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

C# how do I move a folder?

I will have a folder called batch, in it there are other folders request1, request2, request3....
When a folder has been processed, I want to move it from batch to processed.
How can I do this?
Also, these folders will be very large.  Will there be an issue moving them if they are on the same level as batch?

so
batch .....processed on the same level

in batch there will be request1, 2, 3 ...
0
jackjohnson44
Asked:
jackjohnson44
2 Solutions
 
Jini Jose.Net Team LeadCommented:
is the folder having subdirectories ?

System.IO.Directory.Move(@"c:\batch\request1", @"C:\processed\request1");

Open in new window

0
 
systanCommented:
Moving a file or folder is the same as renaming it.

//Folder
System.IO.Directory.Move(@"c:\batch\request1", @"C:\processed\request1");

//File
System.IO.File.Move(@"c:\request.xml", @"c:\processing.xml");
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now