Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dovsure

macrumors newbie
Original poster
Jun 6, 2023
5
1
Batch file rename solution for Windows / OnDrive compatibility

As my company is a windows house, even though they have kindly given me a great Mac I still run into compatibility issues, such as when I try to sync with One Drive, which results in thousands of sync errors due to Windows server lack of support for Finder's less restrictive naming conventions. Seems the only way to resolve this is to rename about 15,000 files! Until I do Onedrive won't sync, including the OneNote folders which contains client critical information. Our IT support aren't able to suggest a solution so I want to ask if anyone knows a simple solution that I can use. Many thanks in advance.
 

dimme

macrumors 68040
Feb 14, 2007
3,036
27,815
SF, CA
I do not use one drive anymore, but I did for years. I would run this script. I learned many years ago to use universal naming conventions because I would need to work on Macs, windows and unix systems. Once you cleanup your naming conventions just delete the .ds files and you should be go to go.
script cd \/Volumes/"path to one drive"/OneDrive
find . -name ".DS_Store" -print -delete
 

gilby101

macrumors 68020
Mar 17, 2010
2,491
1,346
Tasmania
Better Finder Rename is the most powerful GUI app for renaming files. And it has a builtin conversion which cleans up character in file names which will cause problems with Windows and/or SMB file shares.

Screenshot 2023-08-04 at 9.16.17 pm.png

Drag and drop a folder into the box on the right and away you go.

I would do the conversion in a folder outside OneDrive to avoid issues with files only being in the cloud.
 
  • Like
Reactions: dovsure
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.