Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Renaming a directory
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00395201
Message ID:
00395211
Vues:
10
>Hi,
>
>How can I rename a directory from inside VFP6? I suppose is via the API but don't know how to do it.
>
>Thanks.

You can use the Scripting.FileSystemObject to do this. Take a look at www.microsoft.com/scripting/default.htm?/scripting/vbscript/default.htm for more inforamtion. The WSH provides a COM interface to many of the WinAPI functions.

Or you could use to use the WinAPI directly:

Declare Integer MoveFile in "Kernel32" String lpOldName, String lpNewName
lret = MoveFile("OldDirName","NewDirName")
return lret > 0 && 0 means failure

You can not rename a directory so it appears on a different volume (drive).

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform