Solved

C# how do I move a folder?

Posted on 2010-08-18
2
273 Views
Last Modified: 2013-12-17
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
Comment
Question by:jackjohnson44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
Jini Jose earned 250 total points
ID: 33469960
is the folder having subdirectories ?

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

Open in new window

0
 
LVL 14

Assisted Solution

by:systan
systan earned 250 total points
ID: 33470030
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

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question