Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WSH Mania
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00346623
Message ID:
00347373
Views:
28
>>However, let's not limit this to the WSH. There's also the Shell.Application >object. Let's say you've got a large file, that take a minute about to copy >from one location to another. Now you can either use the COPY FILE VFP >command, throwing up a WAIT WINDOW beforehand saying, "Copying file...please >wait!" or you can put up the Windows file copy dialog complete with progress >bar and time count down. Which do you think would be better received by your >users? If you answered the latter option, the Shell.Application object can >give it to you.
>
>I looked at some of the docs on WSH and the Shell but it's a bit above me right now. What would the syntax be to copy a group of files (ie. *.DBF)?
>
>Thanks in Advance for the Help,
>
Hi Eddie,

Sure, not a problem
* lcfiles is a file name with or without wildcards
* lcdir is the target directory
oShell = CREATEOBJECT('Shell.Application')
oFolder = oShell.Application.Namespace(lcdir)
oFolder.CopyHere(lcfiles)
Additionally, you can specify parameters that control how the dialog operates for example pass FOF_NOCONFIRMATION (0x10) so that a confirmation dialog doesn't appear if a file with the same name exists in the target directory. The constants are mentioned in SHFILEOPSTRUCT topic and the values can be found in Shlobj.h in the VC++ Include sub-directory.
George

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

Click here to load this message in the networking platform