Use %~dps0 instead of %~dp0.

For consistency, use short path everywhere.

Raised from #1753.

I can't think of any negative impact of using short-path everywhere, but this needs some thorough testing on Windows before merging.