Some situations still require a short name like a 8.3 name of a file. This will often be on not only the name of the object but on the entire path. Back in the days of the Windows Shell we would use the command dir /x
.
I have looked into getting the short name in a PowerShell script to make it available in a more complex script.
Unfortunately .NET does not have such a method to a FileInfo
or DirectoryInfo
object. So I have used the Win32 function GetShortPathName()
.
The script is in SQLAdmin Github (link) with some technical notes in the associated markdown file.
No comments:
Post a Comment