%O parameter doesn't quote filenames with spaces
Moderators: white, Hacker, petermad, Stefan2
%O parameter doesn't quote filenames with spaces
Well, this certainly seems like a bug, and I couldn't find anything about in the documentation, but I'll probably be told that it's working the way it was intended...
The help files says that the parameter %N inserts the selected filename, and that %O inserts the selected filename without the extension.
Let's say that you have a file called My Book Report.txt
%N = "My Book Report.txt"
%O = My
Yes, you can avoid this by enclosing %O in quotes yourself, but why do you have to?
If this is the intended behavior, can someone please describe to me a scenario where you would only want the first word of a filename containing spaces that isn't a completely obscure and unique one-off case?
The help files says that the parameter %N inserts the selected filename, and that %O inserts the selected filename without the extension.
Let's say that you have a file called My Book Report.txt
%N = "My Book Report.txt"
%O = My
Yes, you can avoid this by enclosing %O in quotes yourself, but why do you have to?
If this is the intended behavior, can someone please describe to me a scenario where you would only want the first word of a filename containing spaces that isn't a completely obscure and unique one-off case?
Re: %O parameter doesn't quote filenames with spaces
Wrong
![Exclamation :!:](./images/smilies/icon_exclaim.gif)
%O = My Book Report
You just have a default behaviour that another program that gets My Book Report split it by spaces if you dont use quotes
![Exclamation :!:](./images/smilies/icon_exclaim.gif)
Because contrary to you programs cant think
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Hoecker sie sind raus!
Re: %O parameter doesn't quote filenames with spaces
"new text %O new text.%E"
Need more explanations?
![Smile :)](./images/smilies/icon_smile.gif)
Overquoting is evil! 👎
- ghisler(Author)
- Site Admin
- Posts: 48088
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: %O parameter doesn't quote filenames with spaces
TC does not add quotes around most parameters like %O because they are often combined with others, e.g. the user could write %O_copy.%E or so.
Quotes are added for %N, %P%%N, %T, %T%M and a few others. User %Q at the start to turn off automatic quotes.
Currently it's not planned to add automatic quotes to more placeholders, sorry.
Quotes are added for %N, %P%%N, %T, %T%M and a few others. User %Q at the start to turn off automatic quotes.
Currently it's not planned to add automatic quotes to more placeholders, sorry.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: %O parameter doesn't quote filenames with spaces
Moderator message from: petermad » 2024-01-23, 19:24 UTC
Moved to "TC Behaviour which will not be changed" from "TC11.x bug reports (English)"
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: %O parameter doesn't quote filenames with spaces
You mean virtually every Windows program in existence?
While there may be some programs that will accept a filename with spaces in it that isn't quoted, the vast majority will interpret space as a delimiter and stop reading a filename there. Can you name a common Windows program that accepts filenames on the command line, which doesn't need filenames with spaces to be enclosed in quotes?
Thank you for the explanation. May I respectfully suggest that the help file should make it clear which parameters will be enclosed in quotes and which won't be? I'm not suggesting that it be stated in the description for each and every parameter, maybe just a note at the top like "Please note, only the following parameters will be enclosed in quotes if they contains spaces, all others you will have to enclose in quotes yourself: %N, %P%N, %T, %T%M..."ghisler(Author) wrote: ↑2024-01-23, 14:26 UTC TC does not add quotes around most parameters like %O because they are often combined with others, e.g. the user could write %O_copy.%E or so.
Quotes are added for %N, %P%%N, %T, %T%M and a few others. User %Q at the start to turn off automatic quotes.
Currently it's not planned to add automatic quotes to more placeholders, sorry.
Re: %O parameter doesn't quote filenames with spaces
I agree that this piece of information should be available in the TC help. Support++
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror