[Help] Rename Script for Total Commander
-
- Posts: 26
- Joined: 11 Feb 2019, 10:11
[Help] Rename Script for Total Commander
Hello,
I'm attempting to write a script that will rename a list of given files.
My intend is to use it with Total Commander to rename selected files.
I have had this working before, but I sadly lost all my data and thus also the script I was using and I just can't seem to figure out how to structure the script to rename specific file.
Any help on this issue would be greatly appreciated!
I'm attempting to write a script that will rename a list of given files.
My intend is to use it with Total Commander to rename selected files.
I have had this working before, but I sadly lost all my data and thus also the script I was using and I just can't seem to figure out how to structure the script to rename specific file.
Any help on this issue would be greatly appreciated!
Re: [Help] Rename Script
Well, I suppose it's a simple as doing a FileBot command line call, and then replacing the input file argument with some variables that are provided by Total Commander.
-
- Posts: 26
- Joined: 11 Feb 2019, 10:11
Re: [Help] Rename Script
Could I trouble you for an example of how one such command line call would look like?
I have tried to read up on it, but I can't seem to figure it out sadly
Re: [Help] Rename Script for Total Commander
This is a question best asked at the Total Commander forum.
If you can figure out how to call any program on select files, then I can help you call filebot specifically on selected files.
If you can figure out how to call any program on select files, then I can help you call filebot specifically on selected files.
-
- Posts: 26
- Joined: 11 Feb 2019, 10:11
Re: [Help] Rename Script for Total Commander
Currently what I was trying is something like this:
Code: Select all
filebot -script fn:renall '%P%N' -non-strict --format "{n.upperInitial().space('.')}.{S00E00}.{t.upperInitial().space('.')}"
This is what I get when trying:

Re: [Help] Rename Script for Total Commander
You're command line is somehow wrong.
It's best to learn how to use the command line tool first without Total Commander, and only integrate with TC once you already get the hang of it directly in CMD.
e.g. your first mistake is using ' which is ok in Unix bash but not Windows CMD.
It's best to learn how to use the command line tool first without Total Commander, and only integrate with TC once you already get the hang of it directly in CMD.
e.g. your first mistake is using ' which is ok in Unix bash but not Windows CMD.
-
- Posts: 26
- Joined: 11 Feb 2019, 10:11
Re: [Help] Rename Script for Total Commander
So I tried it in PS and I got the following:rednoah wrote: ↑12 Feb 2019, 09:15 You're command line is somehow wrong.
It's best to learn how to use the command line tool first without Total Commander, and only integrate with TC once you already get the hang of it directly in CMD.
e.g. your first mistake is using ' which is ok in Unix bash but not Windows CMD.

Not really a useful message I have to say
Re: [Help] Rename Script for Total Commander
Haha, it's a funny one isn't it?
It's a JRE error message, not specific to FileBot. It'll just say if the path is invalid, and then echo the path that's invalid.
In this case, ' is index 0, d is index 1 and : is index 2. So you get the error because index 1 is not : which means the path is not a valid Windows file path, and then it'll just repeat the invalid path, except ' is part of your invalid path, even though it might look like it's part of the error message on first glance.
It's a JRE error message, not specific to FileBot. It'll just say if the path is invalid, and then echo the path that's invalid.
In this case, ' is index 0, d is index 1 and : is index 2. So you get the error because index 1 is not : which means the path is not a valid Windows file path, and then it'll just repeat the invalid path, except ' is part of your invalid path, even though it might look like it's part of the error message on first glance.
-
- Posts: 26
- Joined: 11 Feb 2019, 10:11
Re: [Help] Rename Script for Total Commander
I think you are looking at the wrong imagerednoah wrote: ↑12 Feb 2019, 10:02 Haha, it's a funny one isn't it?
It's a JRE error message, not specific to FileBot. It'll just say if the path is invalid, and then echo the path that's invalid.
In this case, ' is index 0, d is index 1 and : is index 2. So you get the error because index 1 is not : which means the path is not a valid Windows file path, and then it'll just repeat the invalid path, except ' is part of your invalid path, even though it might look like it's part of the error message on first glance.

The message I got was "Done ?(?????)?" which I do not really understand what means
Re: [Help] Rename Script for Total Commander
Just means that Windows CMD can't display unicode characters, and that the script completed without errors.
Why does it not do anything? Because the renall script explicitly deal with folder structures:
viewtopic.php?t=5#p2211
Since you have a very simple use case, that is covered by the the built-in commands just fine, I'm not quite sure why you're using the renall script. The renall script might be useful for large jobs, dealing with large file and folder structures in manageable chunks, and not processing a single file, which apparently doesn't do anything anyway.
You'll want to use the filebot -rename commands as documented in the manual:
https://www.filebot.net/cli.html
Why does it not do anything? Because the renall script explicitly deal with folder structures:
viewtopic.php?t=5#p2211


You'll want to use the filebot -rename commands as documented in the manual:
https://www.filebot.net/cli.html
-
- Posts: 26
- Joined: 11 Feb 2019, 10:11
Re: [Help] Rename Script for Total Commander
huh, that worked.. I could have swore I had tried that already... Thanks man!rednoah wrote: ↑12 Feb 2019, 11:11 Just means that Windows CMD can't display unicode characters, and that the script completed without errors.
Why does it not do anything? Because the renall script explicitly deal with folder structures:
viewtopic.php?t=5#p2211
Since you have a very simple use case, that is covered by the the built-in commands just fine, I'm not quite sure why you're using the renall script. The renall script might be useful for large jobs, dealing with large file and folder structures in manageable chunks, and not processing a single file, which apparently doesn't do anything anyway.
![]()
You'll want to use the filebot -rename commands as documented in the manual:
https://www.filebot.net/cli.html
I really appreciate all of your help and time!
If anyone else reads this thread here is my solution:
Code: Select all
Command: filebot
Parameters: -rename %P%N -non-strict --format "{n.upperInitial().space('.')}.{S00E00}.{t.upperInitial().space('.')}"
Start Path: <Blank>
-
- Posts: 26
- Joined: 11 Feb 2019, 10:11
Re: [Help] Rename Script for Total Commander
Actually, this is all good for one file at a time, but how would one go about renaming multiple files?rednoah wrote: ↑12 Feb 2019, 11:11 Just means that Windows CMD can't display unicode characters, and that the script completed without errors.
Why does it not do anything? Because the renall script explicitly deal with folder structures:
viewtopic.php?t=5#p2211
Since you have a very simple use case, that is covered by the the built-in commands just fine, I'm not quite sure why you're using the renall script. The renall script might be useful for large jobs, dealing with large file and folder structures in manageable chunks, and not processing a single file, which apparently doesn't do anything anyway.
![]()
You'll want to use the filebot -rename commands as documented in the manual:
https://www.filebot.net/cli.html
Specifically a few select files and not a whole folder.
Re: [Help] Rename Script for Total Commander
Passing one file argument works exactly the same as passing many file arguments.
1 select file:
2 select files:
3 select files:
Many select files:
1 select file:
Code: Select all
filebot -rename Alias.1x01.mp4
Code: Select all
filebot -rename Alias.1x01.mp4 Alias.1x02.mp4
Code: Select all
filebot -rename Alias.1x01.mp4 Alias.1x02.mp4 Alias.1x03.mp4
Code: Select all
filebot -rename *.mp4
-
- Posts: 26
- Joined: 11 Feb 2019, 10:11
Re: [Help] Rename Script for Total Commander
Oh that is a lot easier than I thought it would have been!
I thank you again! I really appreciate all of your help!
I thank you again! I really appreciate all of your help!
Re: [Help] Rename Script for Total Commander
And it works exactly the same way for any other reasonably well designed CLI tool. Transferable skills FTW. 
