- 注册时间
- 2010-11-11
- 最后登录
- 2025-5-27
- 阅读权限
- 200
- 积分
- 14361
- 精华
- 2
- 帖子
- 843
  

TA的每日心情 | 无聊 2025-5-27 03:37:20 |
---|
签到天数: 366 天 [LV.9]以坛为家II
我玩的应用:
  
|
文件夹(sub-directry)名称,以前是不允许带空白的,后来允许带空白,但由于有了空白,许多命令出现二义性,于是采用双引号括起来的办法。例如:
cd Documents and Settings
按老定义 等于 CD Documents, CD 命令找不到名叫Documents 的 directry
于是采用双引号:
cd “Documents and Settings“
但用到 set PATH 时很麻烦,名字太长,双引号时常括错。于是采用8个字符缩写,即写头六个字母(略去空白),另加波浪号和1。例如:
"Documents and Settings“ -- DOCUME~1
"Local Settings" -- LOCALS~1 (注意略去空白,用了第二个词的字母,凑成六个,再加波浪号和1)。
于是,这种方法成了规定。
****************************************************
如何将dos 的缩写文件路径转换成原路径(用程序)?
GetLongPathName
[This is preliminary documentation and subject to change.]
The GetLongPathName function converts the specified path to its long form. If no long path is found, this function simply returns the specified name.
DWORD GetLongPathName(
LPCTSTR lpszShortPath,
LPTSTR lpszLongPath,
DWORD cchBuffer
);
Parameters
lpszShortPath
Pointer to a null-terminated path to be converted.
lpszLongPath
Pointer to the buffer to receive the long path. You can use the same buffer you used for the lpszShortPath parameter.
cchBuffer
Specifies the size of the buffer, in characters.
Return Values
If the function succeeds, the return value is the length of the string copied to the lpszLongPath parameter, in characters. This length does not include the terminating null character.
If lpszLongPath is too small, the function returns the size of the buffer required to hold the long path, in characters.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
QuickInfo
Windows NT: Requires version 5.0 or later.
Windows: Requires Windows 98 or later.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
See Also
File I/O Overview, File Functions, GetShortPathName
===================================================中文翻译==============================================GetLongPathName
[这是初步的文件,并随时可能更改。 ]
该GetLongPathName功能转换指定的路径其长期形式。如果没有长期的路径发现,这个功能只是传回指定名称。
的DWORD GetLongPathName (
LPCTSTR lpszShortPath ,
LPTSTR lpszLongPath ,
的DWORD cchBuffer
) ;
参数
lpszShortPath
指向零终止路径转换。
lpszLongPath
指针缓冲区接收的漫长道路。您可以使用相同的缓冲区所使用的lpszShortPath参数。
cchBuffer
指定的大小的缓冲区,在字符。
返回值
如果函数成功,返回值是长度的字符串复制到lpszLongPath参数,在字符。这种长度不包括终止空字符。
如果lpszLongPath太小,该函数返回的大小缓冲区须持有的漫长道路,在字符。
如果函数失败,返回值是零。要获得扩展错误信息,请致电GetLastError 。
QuickInfo
的Windows NT :需要5.0或更高版本。
视窗:需要Windows 98或更高版本。
Windows CE的:不支持的。
标题:宣布winbase.h 。
导入库:使用kernel32.lib 。
的Unicode :实现为Unicode和ANSI版本的Windows NT 。
又见
文件I / O概况,档案功能, GetShortPathName
**********************************************************
DOS 8.3 文件名命名规则
[日记作者:太子 日记来源:本站原创 添加时间:2009-1-1 2]
[字体:大 中 小]
DOS 8.3 文件名命名规则
在用批处理时
对含有空格的文件夹名或文件名,批处理无法读取,找不到地址。
此时要对其进行DOS下的文件夹名或文件名缩写,其规则为8个字符(包括 ~1 两个字符),取文件名的前6个字符,加上~1(如果前六个相同的,依次用~2、~3...),去掉空格,一个中文字为两个字符
比如:
Program Files---------------------Progra~1
i love you-------------------------ilovey~1
i love you too--------------------ilovey~2
我是中国人-------------------------我是中~1
***************************
比如D:\abcdefg\hijklmnopq.doc应该就是D:\abcdef~1\hijklm~1.doc
注意~1指它的顺序
我的D:\Program Files就是D:\progra~2
因为在它之前曾经有Program文件夹,虽然那个文件夹删除了,但是排名是固定下来的
******************************************************************************
是指对文件名的命名规则:文件名(逗点前面部分)为8个字符,后缀名(逗点后面部分)为3个字符.
DOS下命名文件名的一种规格:主文件名是小于等于8个英文字符,扩展名为特定的某3个英文字符,他们之间必须用“.”连接起来,构成一个完整的文件名。
现在,WINDOWS大都支持长文件名和非英文文件名。但有时我们还会在某些场合见到这种“xxxxxx~1.xxx”形式的文件,那就是DOS的识别问题。
******************************************************************************
program~1是转成了短文件名,后面的1代表是当前目录下排序progra六个字母开头的第一个文件夹,如果还有一个文件夹前面六个字符一样,后面的数字类推为2,此处的~为省略的意思。
%~dp0 这个不能单独看~,而是%~为一组,是扩充一个变量的表示,%~dp0表示把当前路径扩充为一个驱动器号+路径,d是驱动器号的意思,p是路径的意思,这里的0是当前路径的意思。
********************************************************************************
dir /?
/X This displays the short names generated for non-8dot3 file
names. The format is that of /N with the short name inserted
before the long name. If no short name is present, blanks are
displayed in its place.
|
|