Forum Discussion

JeffSm's avatar
15 years ago

get full path name...


I have a Windows application that is tested on XP, Vista, and W7 (all in 6 different languages).  In the application I have to enter a path name to a "Bluetooth Exchange Folder" into a field.  In XP it's called "C:\Documents and Settings\<user name>\My Documents\Bluetooth Exchange Folder", and in Vista (I assume W7 also) it's called "C:\Users\<user name>\Documents\Bluetooth Exchange Folder".  I'm looking for a way to get this full path name (assuming that the folder name is the same for each).  I'm writing my scripts in jscript.  Is there an easy way to do this, so that I can plug the full path name into a variable?



2 Replies

  • Hello Jeff,

    You can use the script below to get the full path to the 'Bluetooth Exchange Folder' directory:

      var wshShell = Sys.OleObject("WScript.Shell");

      var path = wshShell.RegRead("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Personal"); 

      Log.Message(path + "\\Bluetooth Exchange Folder");