OneDrive has issues with certain characters in files. In particular files commencing with a space.
Has anyone created a script to change file names to be "OneDrive friendly"? Note that I know the websafe rename option will actually do what I want, but it also changes all spaces to underscores - which I definitely don't want.
Removing or replacing all leading spaces would be easy. Is that all you need it to do, or are there more special rules that OneDrive needs? (What are they?)
The rules about files named CON, PRN, etc. are mostly true of Win32 as well, so you'd be unlikely to have files with those names (unless something went out of its way to make them; there are ways you can do it).
Rules about files named .lock, desktop.ini and with certain Unicode characters make me wonder whether anyone should use OneDrive at all as it doesn't seem very well designed. Those could be handled but you'd need to use a rename script for them.
I have a friend that I met at another company. I helped "fancy-up" the Excel spreadsheet he'd inherited when he was hired.
He came to me a month later and said there were problems with the part of the spreadsheet I had made fancier. It turns out his method of replacing contents in a cell was to click on the cell, press SPACE and then type what he wanted. My formulas didn't like his leading spaces. I taught him to either just start typing (without pressing SPACE) or press DELETE and then start typing. He had no more problems.
It's amazing how many users think typing SPACE "clears" out the field.