如何获取DOS路径而不是Windows路径 [英] how to get DOS path instead of Windows path

查看:89
本文介绍了如何获取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 Files \Java\jdk1.6.0_22,我想显示它的短名称C:\PROGRA〜1 \Java\JDK16〜1.0_2。

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".

我知道运行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天全站免登陆