use Win32::API; my $GetShortPath = new Win32::API ( "kernel32", "GetShortPathName", ['P','P','N'], 'N' ); my $len = 100; my $short = (' ' x $len); my $long = 'c:\\program files\\microsoft office\\'; my $size = $GetShortPath->Call($long, $short, $len); print substr($short,0,$size) . "\n";