如何在 Powershell 或 Windows Command Shell 中设置 FAT32 短名称

发布于 2024-10-01 03:33:52 字数 137 浏览 0 评论 0原文

我需要编写一个脚本来设置 FAT32 文件系统上文件的短名称。在 NTFS 上,我可以在 Windows 下使用 FSUTIL 实用程序,但我似乎无法弄清楚如何对 FAT32 驱动器执行此操作。

窗口命令或 powershell 脚本的额外荣誉

I need to write a script that sets the short name of a file on a FAT32 file system. On NTFS I can use the FSUTIL utility under windows but I cannot seem to fathom out how to do this for a FAT32 drive.

Bonus kudos for a window command or powershell script

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

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

发布评论

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

评论(2

无法回应 2024-10-08 03:33:53

他们让这个问题变得非常难以理解,但这里有一个解决方案:
转换 FileSystemObject 的 ShortName 属性

They made this super hard to get at, but here is one solution:
Converting the FileSystemObject's ShortName Property

萌化 2024-10-08 03:33:53

不幸的是,这是不可能的,因为这是 的限制SetFileShortName() Win32 API,我相信 fsutil 也在底层使用

设置指定文件的短名称。该文件必须位于 NTFS 文件系统卷上。

您可以手动十六进制编辑 FAT32 分区来设置短名称并更新校验和,但如果没有支持,它会非常脆弱从文件系统驱动程序

Unfortunately it's not possible because it's the limitation of the SetFileShortName() Win32 API which I believe fsutil also uses under the hood

Sets the short name for the specified file. The file must be on an NTFS file system volume.

You can manually hex edit the FAT32 partition to set the short names and update the checksums but it'll be quite fragile without support from the file system driver

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