Forum Discussion

Radar's avatar
Radar
Occasional Contributor
13 years ago

Convert Short Path Name to Long Path Name

Hello,



I note we have methods to convert from long to short path names, but not from short to long.

I need to convert from a short to a long path name.



I have a line of code:

tempPath = aqEnvironment.GetEnvironmentVariable("TEMP");



tempPath now equals:

 "C:\DOCUME~1\psp\LOCALS~1\Temp"



Passing this variable into other functions causes unexpected results.

I need to convert this to long path name.



Are you able to assist?



Thanks in advance.

Mark


4 Replies


  • Hi Mark,





    Here is the script than converts a short name to a long name:







    function GetLongName(tempPath)

    {

    var objShell, objFolder;

    objShell=Sys.OleObject("Shell.Application");

    objFolder=objShell.Namespace(tempPath);

    Log.Message(objFolder.Self.Path);

    objShell=null;

    }




  • A post from "Natanvay smith" has been deleted from this thread as unrelated to the topic of discussion and a possible SPAM message.

    Please avoid posting any advertising materials in this Forum, such posts will be deleted.



    Natanvay, if you have any questions, please contact our Support Team.
  • Long Path Tool can simplify and probably end your problems in unlocking, managing and renaming files that appear to have a long filename.



    Since in some instances, you may have experienced problems accessing, managing and even renaming files that have more than 255 characters, this utility has been made to answer this particular scenario. If you have also encountered problems like error messages that tell you that the path too long, too long path, destination path too long or cannot delete file then this program is definitely for you.



    This will totally take place of Windows Explorer, Far Manager or other file managing utilities since this is maybe used in any type of Operating System even the earliest Windows 95 version.





    Long Path Tool