I was going to say mine isn't short, but then I noticed none of my usernames are over 8 characters, nor the other path components, so I don't actually know.
Interestingly, some other Windows "system" settings, e.g. %APPDATA%, %HOMEPATH%, %USERPROFILE% all use the full name. Only %TEMP% and %TMP% are shortened.
I was hoping that FSUtil.Resolve("/temp") would return the real (full) name but it doesn't.
This kind of thing can convert a short path to a long one:
var path = DOpus.FSUtil.NewPath("C:\\PROGRA~1");
DOpus.Output(path.longpath);
For me it only worked when the short path was all uppercase. I'm not sure if the string will be detected as a short path otherwise, or if it has to match the short path on disk (which I think is always uppercase). So your script may need to uppercase the path for it to convert properly.