Mik*_*och 92 windows windows-explorer command-line dotfiles
我目前在我的外部硬盘驱动器的根目录上有一个简单命名的文件._.,我猜它是在不久前在我的 MacBook 上使用后添加到我的硬盘驱动器中的。我试图在我的 Windows 10 机器上删除这个文件;但是 Windows 一直声称找不到该文件。
我还尝试通过提升的命令提示符删除文件;但是返回相同的消息。
有什么办法可以通过 Windows 从我的硬盘驱动器中删除这个文件?
Jos*_*efZ 146
运行以下命令(可能需要提升权限/以管理员身份打开命令提示符):
del "\\?\F:\._."
Run Code Online (Sandbox Code Playgroud)
对于文件 I/O,
\\?\路径字符串的“ ”前缀告诉 Windows API 禁用所有字符串解析并将其后的字符串直接发送到文件系统。...
因为它关闭了路径字符串的自动扩展,"
\\?\" 前缀还允许在路径名中使用 ".." 和 ".",如果您试图对具有这些其他保留相对路径的文件执行操作,这会很有用说明符作为完全限定路径的一部分。
请注意,您不能将“ \\?\” 前缀与相对路径一起使用。
示例:
==> set prog>"\\?\D:\bat\Unusual Names\._."
==> dir "D:\bat\Unusual Names\*"|find "._."
08.11.2015 13:25 132 ._.
==> type "D:\bat\Unusual Names\._."
The system cannot find the file specified.
==> type "\\?\D:\bat\Unusual Names\._."
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
==> del "D:\bat\Unusual Names\._."
Could Not Find D:\bat\Unusual Names\._.
==> del "\\?\D:\bat\Unusual Names\._."
==> dir "D:\bat\Unusual Names\*"|find "._."
==>
Run Code Online (Sandbox Code Playgroud)
小智 24
即使问题已经得到回答,我仍然想提供一个可能的替代解决方案:使用旧的“短名称”(您可以使用 dir 命令的“/x”选项显示)也可以让您掌握您无法以其他方式处理的具有“时髦”名称的文件:
C:\temp\test>dir
Volume in drive C has no label.
Volume Serial Number is 887A-5E48
Directory of C:\temp\test
11.11.2015 16:31 <DIR> .
11.11.2015 16:31 <DIR> ..
11.11.2015 16:31 7 ._.
1 File(s) 7 bytes
2 Dir(s) 44.966.129.664 bytes free
C:\temp\test>dir /x
Volume in drive C has no label.
Volume Serial Number is 887A-5E48
Directory of C:\temp\test
11.11.2015 16:31 <DIR> .
11.11.2015 16:31 <DIR> ..
11.11.2015 16:31 7 _3E35~1 ._.
1 File(s) 7 bytes
2 Dir(s) 44.966.129.664 bytes free
C:\temp\test>del _3e35~1
C:\temp\test>dir
Volume in drive C has no label.
Volume Serial Number is 887A-5E48
Directory of C:\temp\test
11.11.2015 16:31 <DIR> .
11.11.2015 16:31 <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 44.966.129.664 bytes free
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8059 次 |
| 最近记录: |