Get DOS path instead of Windows path

2019-01-03 12:32发布

In a DOS window, how can I get the full DOS name/short name of the directory I am in?

For example, if I am in the directory C:\Program Files\Java\jdk1.6.0_22, I want to display it's short name C:\PROGRA~1\Java\JDK16~1.0_2.

I know running dir /x will give me the short names of files/directories in the current directory but I haven't been able to find a way to display the full path of the current directory in short name format. I'm having to work my way through the path from the root, directory by directory, running dir /x in each.

I'm sure there is an easier way to do this?

8条回答
Melony?
2楼-- · 2019-01-03 13:04

run cmd.exe and do the following:

> cd "long path name"
> command

Then command.com will come up and display only short paths.

source

查看更多
不美不萌又怎样
3楼-- · 2019-01-03 13:05

A someone more direct answer is to fix the bug.

%SPARK_HOME%\bin\spark-class2.cmd; Line 54
Broken: set RUNNER="%JAVA_HOME%\bin\java"
Windows Style: set "RUNNER=%JAVA_HOME%\bin\java"

Otherwise, the RUNNER ends up with quotes, and the command "%RUNNER%" -Xmx128m ... ends up with double-quotes. The result is that the Program and File are treated as separate parameters.

查看更多
登录 后发表回答