You're running into two problems here.
The first is that you told move
to only copy files that have a name that matches the *.*
pattern. Dir1
and Dir2
both do not match *.*
. (Neither has a ".
" (dot) in the name). @Seth pointed this out in a comment on your original post.
The second problem is that move
doesn't have sane (imho) behavior when you ask it to move a folder and a file at the same time. Move simply refuses to move a folder if anything else is trying to be moved at the same time:
Moves a dir into another dir:
move C:\Source\Dir1 C:\Dest\
(now C:\Dest\Dir1
exists)
Only moves files at the top level inside C:\Source\
:
move C:\Source\* C:\Dest\
(now C:\Dest\abc.files
exists)
Produces a syntax error when you try to move two folders at once (neither syntax works for me)
move C:\Source\Dir1,C:\Source\Dir2 C:\Dest\
move C:\Source\Dir1 C:\Source\Dir2 C:\Dest\
The documentation for move
suggests that you should be able to specify multiple files and folders to move at once with a comma (,
) separating the files to be moved but this doesn't seem to work for me.
The documentation does say Moves files and renames files and directories.
suggesting that it really can't move directories...
So, I don't think there is a solution that works for you with the move
command that is available on DOS compatible machines. There are however other newer commands available in more recent versions of Windows that would likely work. xcopy
is a popular one. This unfortunately doesn't work for me because xcopy
does not do a filesystem level move, it only copies and then deletes the original. This is fine for smaller files but can be disastrous with larger files.
automation.bat
) with several inline-commands (DOS ATM). Regardless of the windows version, anyone can do that and use DOSSource
? Also your current filter is looking for objects with a dot.Dir1
etc. don't have that. So just use*
instead and try again instead of*.*
.XCOPY /E /I /Y "Source" "Destination"
(XCOPY) or perhaps (preferably) Robocopy?