Create a bat file in some convenient directory
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"
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
SET and a named variable
Windows Command Prompt has some conventions for handling variables
with spaces in their values that are somewhat hard to learn and understand,
especially if you have a Unix background.
You can do
SET TESTPATH=c:\Program Files (x86)\Android\android-sdk
(with no quotes), or
SET "TESTPATH=c:\Program Files (x86)\Android\android-sdk"
(note the non-intuitive placement of quotes); then
CALL :testargs "%TESTPATH%"