Quote inserted filenames with commas, equals, etc.
Posted: 2017-02-14, 06:30 UTC
When I press Ctrl+Enter on a file or directory name with a space in it, the name is properly double quoted on the command line, but if the name contains some other characters, like a comma, then the name is not quoted.
The problem is that batch files consider a comma (and equals and perhaps other characters) to signify the start of a new parameter.
So, given the batch file "comma_test.bat":
-------------
@echo off
echo * = %*
echo 1 = %1
echo 2 = %2
pause
-------------
Executing it on a directory named "A,B" placed on the command line with Ctrl+Enter results in:
comma_test.bat A,B
-------------
* = A,B
1 = A
2 = B
Press any key to continue . . .
-------------
comma_test.bat A=B
-------------
* = A=B
1 = A
2 = B
Press any key to continue . . .
-------------
Can this please be fixed so that Total Commander double quotes any filenames or directories with such characters?
Thank you!
The problem is that batch files consider a comma (and equals and perhaps other characters) to signify the start of a new parameter.
So, given the batch file "comma_test.bat":
-------------
@echo off
echo * = %*
echo 1 = %1
echo 2 = %2
pause
-------------
Executing it on a directory named "A,B" placed on the command line with Ctrl+Enter results in:
comma_test.bat A,B
-------------
* = A,B
1 = A
2 = B
Press any key to continue . . .
-------------
comma_test.bat A=B
-------------
* = A=B
1 = A
2 = B
Press any key to continue . . .
-------------
Can this please be fixed so that Total Commander double quotes any filenames or directories with such characters?
Thank you!