Because of the program that I use to replace cd....
(which is CD Deluxe - I've been using it on Windows and Linux for more than 13 years and it really should be better known https://github.com/m6z/cd-deluxe)
...doesn't like trailing slashes when the path is within double quotes, which I think clink.exe automatically adds. So I want to remove trailing backslashes on any paths that I pass to CD (or rather `cdd.cmd`, because of CD Deluxe).
From an answer on superuser.com I got this, which removes trailing backslashes from a variable:
Code: Select all
IF %datapath:~-1%==\ SET datapath=%datapath:~0,-1%
Is there any way I can do this?
Alternatively, I believe adding a trailing dot after the backslash will work too.