create a bat file in your current directory and put inside it
command.com then you could copy+paste the short path from that path.
You could just run
command.com and keep doing
cd commands to your current directory too.
In windows batch scripts,
%~s1 expands path parameters to short names. Create this batch file:
I called mine
shortNamePath.cmd and call it like this:
c:\>shortNamePath "c:\Program Files (x86)\Android\android-sdk"
Edit: here's a version that uses the current directory if no parameter was supplied:
if '%1'=='' (%0 .) else echo %~s1
Called without parameters:
C:\Program Files (x86)\Android\android-sdk>shortNamePath
The SET variable example I can't figure out but this is pretty close might need some little fixes to make it work
SET TESTPATH="c:\Program Files (x86)\Android\android-sdk"
CALL :testargs "%TESTPATH%"