Moving Folders within a Folder

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
dubhubb
Posts: 7
Joined: 04 Sep 2009 09:55

Moving Folders within a Folder

#1 Post by dubhubb » 04 Sep 2009 10:04

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!

DccD
Posts: 23
Joined: 26 Aug 2009 19:34

#2 Post by DccD » 06 Sep 2009 23:57

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

dubhubb
Posts: 7
Joined: 04 Sep 2009 09:55

#3 Post by dubhubb » 08 Sep 2009 07:52

I was actually able to get it work using:

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

Post Reply