Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy a zip to Documents folder
Message
From
26/09/2016 10:57:37
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01641333
Message ID:
01641336
Views:
67
>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
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform