in reply to Win32::GetShortPath doesn't always return an 8.3 short Path?

Perhaps the module thinks that it's already a short name as you used the C:\Progra~1\ in your test... a reliable (if _bad_) way would be to issue a my $dir=system("cmd /c dir /x $file"); and then pattern match to capture the bit you wanted?

Replies are listed 'Best First'.
Re: Re: Win32::GetShortPath doesn't always return an 8.3 short Path?
by jimbojones (Friar) on Mar 09, 2004 at 14:55 UTC
    Hi,

    Thanks for the responses. The directory does exist. The "problem" is one with the filesystem. Turns out, if you set a Windows Registry key
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\FileSystem\NtfsDis +able8dot3NameCreation
    the filesystem will not allow a short file name to be aliased to the long file. The sysadmins on the machine had set this key for security purposes. I assume that the GetShortPath routine calls the system dll, assuming the "short" value returned is in 8.3 format, although it's now not guarenteed to be. So it's not a Perl problem per se, although the Perl doc is not absolutely correct.

    Again, thanks for the responses.