Preet Sangha
Preet Sangha

Reputation: 65516

How to set FAT32 short names in Powershell or Windows Command Shell

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

Upvotes: 3

Views: 1633

Answers (2)

phuclv
phuclv

Reputation: 41814

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

Upvotes: 0

sukkerfri
sukkerfri

Reputation: 9

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

Upvotes: 0

Related Questions