N must be at least 1 and not greater than 128. MT :: Do multi-threaded copies with n threads (default 8). SL :: copy symbolic links versus the target. IPG:n :: Inter-Packet Gap (ms), to free bandwidth on slow lines. PF :: check run hours on a Per File (not per pass) basis. RH:hhmm-hhmm :: Run Hours - times when new copies may be started. MOT:m :: MOnitor source run again in m minutes Time, if changed. MON:n :: MONitor source run again when more than n changes seen. 256 :: turn off very long path (> 256 characters) support. FAT :: create destination files using 8.3 FAT file names only. CREATE :: CREATE directory tree and zero-length files only. A-: :: remove the given Attributes from copied files. A+: :: add the given Attributes to copied files. MOVE :: MOVE files AND dirs (delete from source after copying). MOV :: MOVe files (delete from source after copying). MIR :: MIRror a directory tree (equivalent to /E plus /PURGE). PURGE :: delete dest files/dirs that no longer exist in source. TIMFIX :: FIX file TIMes on all files, even skipped files. SECFIX :: FIX file SECurity on all files, even skipped files. NOCOPY :: COPY NO file info (useful with /PURGE). COPYALL :: COPY ALL file info (equivalent to /COPY:DATSOU). SEC :: copy files with SECurity (equivalent to /COPY:DATS). (S=Security=NTFS ACLs, O=Owner info, U=aUditing info). (copyflags : D=Data, A=Attributes, T=Timestamps). COPY:copyflag :: what to COPY for files (default is /COPY:DAT). EFSRAW :: copy all encrypted files in EFS RAW mode. ZB :: use restartable mode if access denied use Backup mode. LEV:n :: only copy the top n LEVels of the source directory tree. E :: copy subdirectories, including Empty ones. S :: copy Subdirectories, but not empty ones. Source :: Source Directory (drive:\path or \\server\share\path).ĭestination :: Destination Dir (drive:\path or \\server\share\path).įile :: File(s) to copy (names/wildcards: default is "*.*"). Started : Fri Aug 06 11:51:26 2010 Usage :: ROBOCOPY source destination. Have you tried the /MOV option? /MOV :: MOVe files (delete from source after copying). Robocopy defaults to RETRY A MILLION times and WAIT 30 SECONDS between each try, so you may wish to add /R:1 /W:1 to the robocopy arguments. ~nxi in the destination is a FOR SUBSTITUTION VARIABLE ( See FOR /? ) where ~nxi represents the name and extension of the item currently being looped through. Note the double %% is for usage in a batch file, pasting into a command line needs these changed to a single percentage mark. Working solution: MKDIR "%MoveDirDestination%"įOR %%i IN ("%MoveDirSource%\*") DO MOVE /Y "%%i" "%MoveDirDestination%\%%~nxi"įOR /D %%i IN ("%MoveDirSource%\*") DO ROBOCOPY /MOVE /E "%%i" "%MoveDirDestination%\%%~nxi"įirst two lines move top level files, the third moves folders. Problem: Leaves empty folder structure behind in source folder. Suggestion: ROBOCOPY "%MoveDirSource%" "%MoveDirDestination%" /MOV /E Suggestion: ROBOCOPY "%MoveDirSource%" "%MoveDirDestination%" /MOVE /E /XD "%MoveDirSource%" Suggestion: ROBOCOPY "%MoveDirSource%" "%MoveDirDestination%" /MOVE /E Here are my findings and solution from tests on a Windows 7 machine. I have been trying to do the same from a network share.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |