Solved Command line wildcard does not work for moving folders

March 8, 2013 at 18:12:56
Specs: Windows XP
I want to move a lot of folders with a variety of names from one directory to another. The problem I have seems to be that the command:
move c:\test\*.* d:\test2
does not work if the test directory is populated with subfolders. It is the subfolders and their contents that I wish to move.
Xcopy works great but leaves the files in the original folder.
However, the xcopy command would be great if I could then delete the subfolder and its contents afterwords. Ideally any subfolder/file over 30 days old.

See More: Command line wildcard does not work for moving folders

Report •

March 9, 2013 at 02:11:12
I'm not up on line commands, and correct me if I am wrong, but it looks like your not going from one "directory" to another but one partition to another. From C drive to D drive ( or partition, in the case of 1 actual drive).
So when you go from one to the other you need to manually delete after a "copy/paste" or "move to" .
A "move to " from one directory to another "within the same partition" (weather C or D ) would actually move everything, without a trace of it.

In this case it's the same as having a flash drive and copying something to it, and maintaining your original. Because they are separate partitions

Report •

March 9, 2013 at 09:06:05
✔ Best Answer
You need a real man of a command for the job - "robocopy". Try

robocopy c:\test c:\test2 /s /mov

Robocopy comes in Vista and above as standard. For XP get it from the Resource Kit Tools: . It has a lot of useful capabilities.

Report •

March 10, 2013 at 11:37:17
You could use one of the the enhanced utilities like robocopy, or by command line you need a command that supports recursion:

xcopy /s source\*.* destination

you will have to make the destination directory (md) first.

Then you can nuke the source if not needed:

del /s source

type <command> /? for full syntax

Report •

Related Solutions

Ask Question