cancel
Showing results for 
Search instead for 
Did you mean: 

get full path name...

JeffSm
Contributor

get full path name...

Hi,



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?



Thanks!



Jeff
2 REPLIES 2
Madhi
Contributor

RE: get full path name...

Sys.Username will get you the username.
AlexanderM
Staff

RE: get full path name...


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");


-----

Alexander
Customer Care Manager
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors