ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Move specific file types with original folder path included to another directory

<< < (3/3)

4wd:
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)
--- End quote ---


--- Code: Text ---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)
--- End quote ---

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)
--- End quote ---


--- Code: Text ---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 ---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 ---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.

questorfla:
Merry Christmas and Happy New year to Everyone on the Board.  I was offline for the last part of the month (restrictions by the Wife in Charge) due to family all being together for first time in years. :)

To answer all the great replies though:
 
Shades.  You are always the one to [point out the logical fact-forward solutions.  To be honest, this is what the person who is doing this SHOULD be doing.  That was why I agreed to allow them to do it.
Instead, they created about 5 MORE top level folders with LONG names and used drag and drop to put all the other folders in those Five.  Things immediately went from "Worst to Worser"  :(  I had explained the problem and almost cried when I saw her solution.  Fortunately, I only allowed her to work with a copy of the original mess so..

Wraith:  Thanks for the comments on OneDrive.
I will take another look.  It has been a long time.  Every now and again, i peek at what has 'gathered itself" into my own one drive.  The other day, i tried to copy what was in it to another location and ran into a bunch of errors that basically said the files were not "available at  that time" .  Most of the errors were on larger files and none of these were anything i deliberately put into One Drive so i fully admit that I have not given it a fair test.  If it works for you, i should see what happens on another trial.   
The biggest problem we would have is constant flux.  We have  TON of storage with our Business OneDrive and the files would be constantly added, changed, moved etc.  That is going to need a ton of bandwidth. All that currently is all handled inhouse at gigabit speeds (or close) and I’m not sure how much of a hit we can take on our 30 MB (UP) Cable Pipe to the web.   Worth looking at if it works for you though.

And Lastly, 4WD!
😊 I Knew i could count on you having some great suggestions.  Seems like you must do a lot of the same things i have to do.  But you usually know all the best ways to do it.  I'm lookng forward to somebody coming out with an AI that can look at the problem and come up with best answer (one tha can be afforded by the little guys anyway, I'm sure Siri or Alexa could handle it with ease !)
At least you are patient enough to read the blasted HowTo's on Robo.  Some of your suggestions look Very Interesting though and I plan on trying them ALL out ASAP.

Wishing everyone a Great High-Tech New Year  for 2019. 

Again, thanks to all for the great suggestions

wraith808:
You might be running afoul of the on-demand file option.  I keep my files on the machines where I sync to in all cases.  In the settings dialog, you can find the option.

Move specific file types with original folder path included to another directory

My major problem that I've been running into with OneDrive was actually the reason I finally buckled down and turned off automatic updates to Windows 10.  Sometimes, when Windows 10 would do those, it would turn off OneDrive (I think it was a problem with copying a new version while the old version was still running).  Since I turned off automatic updates (WUB to the rescue), I haven't had that problem.

4wd:
At least you are patient enough to read the blasted HowTo's on Robo.-questorfla (January 03, 2019, 10:40 AM)
--- End quote ---

robocopy /?

HowTo's not required  ;)

Navigation

[0] Message Index

[*] Previous page

Go to full version