Page 1 of 1

Moving Folders within a Folder

Posted: 04 Sep 2009 10:04
by dubhubb
Well I'm fairly new to batch files and I can't seem to figure out how to move some folders.

Basically have a folder called "Output" and within I have four other Folders.

I need to move the folders within "Output" to a folder named data. Here is what I got:

move %userprofile%\desktop\output\ %userprofile%\desktop\data


When I run this it just gives me an error, I know I just need to add more syntax after the "output\" to get it to select the folders and move them, but I am not for what.

Thanks!

Posted: 06 Sep 2009 23:57
by DccD
The move command can only move files and rename folder. I think you need to use XCOPY then erase the original folder with the RD command

Posted: 08 Sep 2009 07:52
by dubhubb
I was actually able to get it work using:

FOR /D %%I IN (%userprofile%\desktop\output\*) DO move "%%I" %userprofile%\desktop\data