Batch file for renaming files and folders

Joined
Dec 12, 2011
Messages
5
Reaction score
0
Points
1
Hello folks, I'm on the process of migrating some data from a Mac server to a Windows server.

I'm using robocopy which is great, however I have ran into a little issue. As I'm sure you all know there are certain characters that you cannot use in a folder or file name in Windows.

I've got loads of folders and files on the shares on this Mac that have characters such as /?*! in them.

Can anybody suggest a batch file/script that I can run to find and strip all of these characters out of any folders or files it finds with these.

I do have a Finder script which can do this, however it only runs in the folder you have open in Finder when you run it. I'd like a script that I can run from the root of where the shares are stored which runs through them all. Hope that all makes sense!!! ;D Can anybody help?
 
Joined
May 22, 2005
Messages
2,159
Reaction score
67
Points
48
Location
Closer than you think.
Your Mac's Specs
Performa 6116 2GBSCSI 8MB OS 7.5.3
How about an Automator workflow to do the rename?

Using the Ask for Finder Items, and the Replace Text library items.
 
OP
Y
Joined
Dec 12, 2011
Messages
5
Reaction score
0
Points
1
How about an Automator workflow to do the rename?

Using the Ask for Finder Items, and the Replace Text library items.

Thanks for the reply MacsWork :D

I tried using Automator and it works great if I try and run it on any folders that are on the drive where OSX is installed.

However it fails if I try and run it on any of the shares (which are on a separate drive) - I get the error:

"Unable to search in scope".

I'm logged into the server with the admin account - any ideas?
 
Joined
May 22, 2005
Messages
2,159
Reaction score
67
Points
48
Location
Closer than you think.
Your Mac's Specs
Performa 6116 2GBSCSI 8MB OS 7.5.3
OS X server?
If so run it from the server.

Are you connected to the server via AFP, SMB or NFS?
What are the POSIX and/or ACL permissions for the user mounting the share?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top