Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Xcopy and deltree simulations
Message
De
23/08/1999 19:25:27
 
 
À
23/08/1999 19:17:02
Mark Lauahi
Advanced Motion Controls
Camarillo, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00254304
Message ID:
00256867
Vues:
37
>>>Does anyone know what the appropriate API calls would be in VFP that would allow for the select of a directory or a root directory and then xcopy it to a local drive. My function works currently with XCOPY32 but I would like to replace this with an API call.
>>>
>>>Also does anyone know what the call would be to simulate a windows DELTREE command on the local drive
>>
>>Rather than an API call, I'd recommend installing the Windows Scripting Host files on your target PCs, and then using Scripting.FileSystemObject to perform the necessary work. You can get more information on the WSH (part of Win98 and Win2K, and addable to almost any system by running a self-installing, redistributable exectable that can be downloaded from the same web site) at msdn.microsoft.com/scripting
>
>I have windows scripting and use it for all sorts of fun things like drive mappings, and adding printers. I must admit that I am complexed by how this would serve me in the area of DOS functions. I was reading a little on the interrupts and thought that would be a little more self explanable, but it wasnt. Any direction on how I might deploy a WIndows script that would simulate a DOS XCOPY or DELTREE funtion.

Take a look at the Scripting.FileSystemObject - it has methods for copying/deleting folders and/or files. There's no 'simulation' needed - the following would delete the C:\WIDOWS\TEMP directory and anything subordinate to it:

oFSO = CREATEOBJ('Scripting.FileSystemObject')
oFSO.DeleteFolder('C:\Windows\Temp')

You could write the same thing in VBScript, JScript, or whatever language you wanted to use. The same thing in VBScript:

DIM fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder("C:\Windows\Temp")
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform