I need to do a .bat copy of a .sh, I don\'t know much Windows cmd. On Linux I could do
mv ...
or
rsync -a SOURCE/ DEST/ --remov
The move
command can move directories as well as files.
cd /d C:\sourceFolder
rem move the files
for %%i in (*) do move "%%i" C:\destinationFolder
rem move the directories
for /d %%i in (*) do move "%%i" C:\destinationFolder
I know this is an old thread, but since it does not have a correct answer I figured I'd tie it off.
The old DOS command to accomplish this is:
move <source directory> <destination directory>
So in the OP question:
move C:\sourceFolder c:\destinationFolder
The folder and everything in the folder (including sub-directories) will be moved.
XCOPY should do the trick, I use it it in batch files all the time
something like, if you're just trying to target .sh files
XCOPY /E /H /Y /C "%SOURCEDIR%\*.sh" "%TARGETDIR%"
Let me know if you have more questions
@echo off
setlocal
set DIR=
set OUTPUTDIR=C:\Documents and Settings\<username>\Desktop\sandbox1\output
for /R %DIR% %%a in (*.jpg) do xcopy "%%a" "%OUTPUTDIR%"
Robocopy did wonders for me:
robocopy c:\cache c:\cache-2012 ?????-2012*.hash /S /MOV
I used it to move all files with certain mask out of c:\cache
and its numerous subdirectories.
For recursive move in windows, a simple move
command is ok. Here is the example, I think it would be helpful.
move D:\Dbbackup\*.dmp* D:\Dbbackup\year\month\
Where .dmp
is the extension of the file that would be moved to the location recursive folder Dbbackup , then year, then month.