Renaming entire path of a selected file

Hi.

I've got a nice button constructed which takes all selected files, removes space characters, and feeds them into a .bat file.

Problem is, the .bat file also hates spaces in the file PATH.

Here is what I got.

Rename PATTERN=" " TO="_" FINDREP

Is there any way to make a command which would also remove spaces in the entire file PATH? Actually changing the name of the folder itself?

Thanks.

Batch files only truncate the file names and paths sent to it if those names and paths are not enclosed in double quotes. For example if you send

C:\test files\

To a batch file, only

C:\test

Will be used by the batch file. On the other hand if you send

"C:\test files"

Then

"C:\test files"

Will be used by the batch file. If you want the batch file to strip the double quotes, instead of using

%1 (or whichever argument you use)

Use %~1 which will remove the double quotes.

I know this isn't what you actually asked for but it sounds like it's the direction you might want to be going.

No reason a batch can't handle file paths containing spaces, as John says, but if you don't want to fix the batch file an alternative is telling Opus to pass short names to the batch instead of long names. (It's just a different argument code.)

Thx

The bat file already has so many %~n1, %~dpn1, and %~dp1 that I'll leave it up to the management to figure out where the %~1s should go.

But as far as the DOpus solution, I should just look for an "F" in the xml code and replace it with an "f" and that would do the trick?

Not if I understand what you're trying to do. An {F} control code will send the fully qualified names (meaning including full paths and double quotes if the file names have spaces) of all of the files and folders you have selected in Opus to your batch file in a group.

An {f} is similar but it will launch a new instance of the batch file one at a time for each selected file or folder.

So if {F} is working but not for files with spaces in the name, try changing {F} to {Fs} or {allfilepathshort$} to send the 8.3 short names with paths to your batch file.

Or you could tweak the batch file as mentioned above so it will process file names with spaces.