Suppose I wish to get the absolute path of a batch script from within the batch script itself, but without a trailing backslash. Normally, I do it this way:
SET
The simplest solution that worked for me was
Instead of using : SET currentPath=%~dp0
SET currentPath=%~dp0
USE : SET currentPath=%cd%
SET currentPath=%cd%