Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting full path of a folder (directory)
Message
 
To
03/06/2003 09:24:18
Fabian Belo
Independent Developer
Argentina
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00795602
Message ID:
00795630
Views:
19
>>>Dear all;
>>>
>>>This one comes from a Spanish forum…
>>>In this particular case the full path name of the “Cookies” folder is required which may vary depending on OS.
>>>I’ve tried WSH (FileSystemObject) which includes several and useful methods to deal with file issues including GetSpecialFolder. No luck so far.
>>>I’ve also tried a couple of functions as “myadir” available in UT download section which do the work but it takes too much time to read&store folders and subfolders paths (in array or cursor mode)
>>>
>>>I think “Cookies” Folder Path is stored somewhere in the registry. I ALSO tried to read the registry at some locations (using Rick Strahl class), i.e.: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders where that path is shown, but the default value is not set, therefore it returns .NULL.
>>>
>>>Any ideas? (VFP6.0 SP_ALL)
>>
>>You can use the Shell.Application for this, but you'll have to parse the path. For example
#DEFINE COOKIES 0x21
>>oShell = CREATEOBJECT("Shell.Application")
>>oFolder = oShell.Namespace(COOKIES)
>>? oFolder.Title
>>oParent = oFolder.ParentFolder
>>? oParent.Title
>>oParent = oParent.ParentFolder
>>? oParent.Title
>
>Thank you George, BTW in order to solve this issue I've read your article (with Ed Rauh) about WSH translated by Martin Salias at http://www.microsoft.com/spanish/msdn/articulos/archivo/mtj/voices/art03.asp
>Very useful.

You're welcome, Fabian. Glad you found the article useful. It's a translation of the five part series that Ed and I did for the VFUG newsletter. I did an article a couple of months prior to the start of the series on the Shell.Application, although I don't think that I touched on the .Namespace() method and doing something like the above.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform