获取 DOS 路径而不是 Windows 路径 [英] Get DOS path instead of Windows path

查看:22
本文介绍了获取 DOS 路径而不是 Windows 路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 DOS 窗口中,如何获取我所在目录的完整 DOS 名称/短名称?

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

例如,如果我在目录C:Program FilesJavajdk1.6.0_22中,我想显示它的短名称C:PROGRA~1JavaJDK16~1.0_2.

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

我知道运行 dir/x 会给我当前目录中文件/目录的短名称,但我还没有找到显示当前目录完整路径的方法以短名称格式.我必须从根目录开始,逐个目录地遍历路径,在每个目录中运行 dir/x.

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?

推荐答案

for %I in (.) do echo %~sI

有更简单的方法吗?

这篇关于获取 DOS 路径而不是 Windows 路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆