fsu.Resolve returns temp aliases in DOS notation

fsu.Resolve returns temp aliases and environment variables in DOS 8.3 notation.

Everything else gets resolved to paths with normal notation.

Is there a way to get the full path for the three variables?

var fsu = DOpus.FSUtil();
DOpus.Output(fsu.Resolve('%temp%'));
DOpus.Output(fsu.Resolve('%tmp%'));
DOpus.Output(fsu.Resolve('/temp'));
DOpus.Output(fsu.Resolve('%userprofile%'));
DOpus.Output(fsu.Resolve('/profile'));

What does echo %temp% show from a command prompt?

I guess that's your answer :smiley:

We'll add a flag to Resolve() in 13.8.1 which will let you get the long filename path from the short filename version.

2 Likes

Yep :smiley:

Windows is pretty stubborn in this regard:

var fso = new ActiveXObject('Scripting.FileSystemObject');
var wsh = new ActiveXObject('WScript.Shell');

var f = wsh.ExpandEnvironmentStrings('%userprofile%');

DOpus.Output(fso.GetFolder(f).Path);
DOpus.Output(fso.GetFolder(f).ShortPath);


var f = wsh.ExpandEnvironmentStrings('%temp%');

DOpus.Output(fso.GetFolder(f).Path);
DOpus.Output(fso.GetFolder(f).ShortPath);

:+1: