Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy a zip to Documents folder
Message
From
26/09/2016 14:19:02
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01641333
Message ID:
01641357
Views:
46
http://www.sevenforums.com/general-discussion/175858-confused-between-difference-my-documents-documents-win7.html

>Frank, this does work great... but on Windows 7 the function returns "C:\Users\Lenovo\Documents\" instead of "C:\Users\Lenovo\My Documents\".
>
>The latter is what it actually is if you open up that path. Can I assume these are in fact the same?
>
>
>
>>>Can someone give me the proper code to copy a "My.zip" file to the Documents folder that will work on all version of Windows?
>>>
>>>Also, is there anyway to create a Subfolder within the Documents folder on the fly?
>>>
>>>Thanks in advance for the help.....
>>
>>Hi Mel,
>>
>>I assume your major problem is just getting the Documents path. Here is one bit of code (it is from Craig Boyd's - at least I think it's his - GridExtras)
>>
>>
#DEFINE CSIDL_PERSONAL 0x0005
>>LOCAL lcFolderPath, lcDocumentsPath
>>m.lcFolderPath = space(255)
>>
>>DECLARE SHORT SHGetFolderPath IN SHFolder.dll ; 
>>    INTEGER hwndOwner, INTEGER nFolder, INTEGER hToken, ; 
>>    INTEGER dwFlags, STRING @pszPath 
>>
>>SHGetFolderPath(0, CSIDL_PERSONAL, 0, 0, @m.lcFolderPath)
>>
>>m.lcDocumentsPath = Alltrim(m.lcFolderPath)
>>
>>m.lcDocumentsPath = SubStr(m.lcDocumentsPath,1, Len(m.lcDocumentsPath) - 1)
>>RETURN ADDBS(m.lcDocumentsPath)
>>
>>You can use MKDIR to create a folder
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform