601
General Software Discussion / Re: Move specific file types with original folder path included to another directory
« Last post by 4wd on December 17, 2018, 12:45 AM »I need to move all files of specific file-types from Folder A to Folder B and put them under the same path as they existed in A.-questorfla (December 15, 2018, 01:08 PM)
Code: Text [Select]
- robocopy.exe "C:\SCRIPTS\A" "C:\SCRIPTS\B" "*.docx" /MOV /R:0 /W:0 /E /Z /Copy:DT /LOG:"C:\SCRIPTS\EMPTY.LOG"
I have heard that MicroSoft has promised to open up the path lengths allowed to some really extreme number in a soon to be released version of Win 10. And i think it can even be enabled now with some registry edits. But as far as I can tell, the original Max_Path of 260 total is still the rule at this time.-questorfla (December 16, 2018, 04:12 PM)
If you want to bypass the max path length problem use extended-length path addressing, (eg. \\?\D:\somelongpath), maximum path length is then restricted to ~32,767 characters.
I have been told that I can even shorten this but here is the Working Script to create an empty copy of a dir with only all paths-questorfla (December 16, 2018, 12:34 AM)
Code: Text [Select]
- robocopy.exe "C:\SCRIPTS\A" "C:\SCRIPTS\B" /CREATE /E /XF "*.???" /LOG:"C:\SCRIPTS\EMPTY.LOG"
Since you're only recreating the directory tree you're not copying any files so /Copy:DT and /Z aren't used, you don't really need /R:0 or /W:0 either.
Remove /XF "*.???" and it'll create zero length files as well.
BTW, what happens if you have an extension longer than 3 characters, eg. .docx ?
Wouldn't /XF "*.*" be better ?
Also btw, before investing in commercial software to sync files/folders, Robocopy is quite capable of doing it either on the number of changes seen or a time interval.
Code: Text [Select]
- robocopy.exe "C:\SCRIPTS\A" "C:\SCRIPTS\B" "*.docx" /MOV /MON:3 /R:0 /W:0 /E /Z /Copy:DT /LOG:"C:\SCRIPTS\EMPTY.LOG"
Will check every minute to see if there has been at least 3 changes to the filesystem involving DOCX files.
Code: Text [Select]
- robocopy.exe "C:\SCRIPTS\A" "C:\SCRIPTS\B" "*.pdf" /MOV /MOT:3 /R:0 /W:0 /E /Z /Copy:DT /LOG:"C:\SCRIPTS\EMPTY.LOG"
Will check every three minutes to see if there has been any changes to the filesystem involving PDF files.
Check the /MON and /MOT options.