“目录*759*”不返回名称中包含 759 的文件。这是 Windows 7 的问题吗?

发布于 2024-10-18 20:45:15 字数 991 浏览 0 评论 0原文

我刚刚打开命令提示符并执行了以下操作:

DIR *759*

令我惊讶的是,它没有返回名称中包含 759 的文件。

结果如下:

56CheckRegister_0710.RTF
c5e64017_2007-09-30.pgp
C5X87050_200601.PRT
c5e64017_2008-09-30.pgp
K6CheckRegister_0110.RTF
K6CheckRegister_0910.RTF
K7CheckRegister_1108.RTF
K7CheckSummary_1299.RTF

这个 DIR 应该工作吗?
我本来可以发誓它以前可以工作,但自从升级到 Windows 7 以来我就没有这样做过。
这是 Windows 7 的问题吗?

已编辑: Dwidle 是正确的。它正在获取 DOS 8.3 名称。使用 DIR /x 返回第一列中的短名称。

561759~1.RTF 56CheckRegister_0710.RTF  
C52759~1.PGP c5e64017_2007-09-30.pgp  
C54759~1.PRT C5X87050_200601.PRT  
C5A759~1.PGP c5e64017_2008-09-30.pgp  
             c5p75922.prt  
             c5p75978.prt  
K63759~1.RTF K6CheckRegister_0110.RTF  
K64759~1.RTF K6CheckRegister_0910.RTF  
K75759~1.RTF K7CheckRegister_1108.RTF  
K7C759~1.RTF K7CheckSummary_1299.RTF`
561759~1.RTF 56CheckRegister_0710.RTF  

I just opened a command prompt and did a:

DIR *759*

To my surprised, it did not return files containing 759 in the name.

Here are the results:

56CheckRegister_0710.RTF
c5e64017_2007-09-30.pgp
C5X87050_200601.PRT
c5e64017_2008-09-30.pgp
K6CheckRegister_0110.RTF
K6CheckRegister_0910.RTF
K7CheckRegister_1108.RTF
K7CheckSummary_1299.RTF

Should this DIR work?
I could have sworn it worked before but I have not done this since upgrading to Windows 7.
Is this a Windows 7 issue?

Edited: Dwidle was correct. It is picking up the DOS 8.3 Name. Using the DIR /x returned the short name in the first column.

561759~1.RTF 56CheckRegister_0710.RTF  
C52759~1.PGP c5e64017_2007-09-30.pgp  
C54759~1.PRT C5X87050_200601.PRT  
C5A759~1.PGP c5e64017_2008-09-30.pgp  
             c5p75922.prt  
             c5p75978.prt  
K63759~1.RTF K6CheckRegister_0110.RTF  
K64759~1.RTF K6CheckRegister_0910.RTF  
K75759~1.RTF K7CheckRegister_1108.RTF  
K7C759~1.RTF K7CheckSummary_1299.RTF`
561759~1.RTF 56CheckRegister_0710.RTF  

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

染墨丶若流云 2024-10-25 20:45:15

它正在查找短名称,即从长名称生成的旧 dos 8.3 名称。使用 /x 开关也可以查看短名称,我打赌他们会有 759。

这将获得长名称中带有 759 的文件。

dir *759* /b | findstr /M 759

It's finding the short name, the old dos 8.3 name that's generated from the long name. use the /x switch to see the short name as well and I bet they will have 759.

This will get files with 759 in the long name.

dir *759* /b | findstr /M 759
爱的那么颓废 2024-10-25 20:45:15

我也可以这样做

C:\Users\ALAIN>doskey dir=dir

C:\Users\ALAIN>dir *759*
 Le volume dans le lecteur C s'appelle Acer
 Le numéro de série du volume est 12D1-55F6

 Répertoire de C:\Users\ALAIN

22/02/2011  22:25    <REP>          .
22/02/2011  22:25    <REP>          ..
22/02/2011  22:24               877 56CheckRegister_0710.RTF
22/02/2011  22:24               938 c5e64017_2007-09-30.pgp
22/02/2011  22:24             1 056 c5e64017_2008-09-30.pgp
22/02/2011  22:24               995 C5X87050_200601.PRT
22/02/2011  22:25             1 118 K6CheckRegister_0110.RTF
22/02/2011  22:25             1 180 K6CheckRegister_0910.RTF
22/02/2011  22:25             1 242 K7CheckRegister_1108.RTF

               7 fichier(s)            7 406 octets
              13 Rép(s)  79 641 792 512 octets libres

C:\Users\ALAIN>doskey dir=

C:\Users\ALAIN>dir *759*
 Le volume dans le lecteur C s'appelle Acer
 Le numéro de série du volume est 12D1-55F6

 Répertoire de C:\Users\ALAIN

Fichier introuvable

C:\Users\ALAIN>

请同时查看其他不太令人愉快的可能解释

  1. “盗版别名”(可以在 HKLM\SOFTWARE\Microsoft\CurrentVersion\App Paths

  2. Rootkit(请参阅 sysinternals Rootkit 检测器)

I can do that as well

C:\Users\ALAIN>doskey dir=dir

C:\Users\ALAIN>dir *759*
 Le volume dans le lecteur C s'appelle Acer
 Le numéro de série du volume est 12D1-55F6

 Répertoire de C:\Users\ALAIN

22/02/2011  22:25    <REP>          .
22/02/2011  22:25    <REP>          ..
22/02/2011  22:24               877 56CheckRegister_0710.RTF
22/02/2011  22:24               938 c5e64017_2007-09-30.pgp
22/02/2011  22:24             1 056 c5e64017_2008-09-30.pgp
22/02/2011  22:24               995 C5X87050_200601.PRT
22/02/2011  22:25             1 118 K6CheckRegister_0110.RTF
22/02/2011  22:25             1 180 K6CheckRegister_0910.RTF
22/02/2011  22:25             1 242 K7CheckRegister_1108.RTF

               7 fichier(s)            7 406 octets
              13 Rép(s)  79 641 792 512 octets libres

C:\Users\ALAIN>doskey dir=

C:\Users\ALAIN>dir *759*
 Le volume dans le lecteur C s'appelle Acer
 Le numéro de série du volume est 12D1-55F6

 Répertoire de C:\Users\ALAIN

Fichier introuvable

C:\Users\ALAIN>

Please also look at other less pleasant possible explanations

  1. A "pirate alias" (can be defined in HKLM\SOFTWARE\Microsoft\CurrentVersion\App Paths

  2. A rootkit (see sysinternals rootkit detector)

眼睛会笑 2024-10-25 20:45:15

这就是 Windows NT 按设计工作,并且已经工作了很长时间。这种行为是众所周知的。不涉及 rootkit 或“盗版别名”。

正如我在 SuperUser 上写的,其中 另一个答案谈论更改系统设置以阻止这种情况发生比现在更进一步,这根据命令解释器使用的 DIR 命令而有所不同。 Take Command 中的 DIR 命令,例如,默认情况下仅匹配长名称,因此不会不要表现出这种行为。 (短名称和长名称的匹配可以打开以与 CMD 的 DIR 命令兼容。)因此,有一些方法可以解决这个问题,不需要 FSUTIL 和管理员权限。

This is Windows NT working as designed, and as it has worked for a long time. This behaviour is widely known. There are no rootkits or "pirate aliases" involved.

As I wrote over on SuperUser, where another answer talks about changing system settings to stop this from happening further than it already does, this varies according to what command interpreter's DIR command one uses. The DIR command in Take Command, for example, only matches long names by default and so doesn't exhibit this behaviour. (Matching of short as well as long names can be turned on for compatibility with CMD's DIR command.) So there are ways to address this that don't require FSUTIL and administrator privileges.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文