Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Renaming directory's
Message
 
À
14/09/2000 08:44:52
Joao Godinho
Fredesenvolv, Lda
Lisbon, Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00416309
Message ID:
00416312
Vues:
17
>How can i rename a directory without using
>_dir1 = "dbaccount2000"
>_dir2 = "dbaccount2001"
>
>! ren &_dir1 &_dir2
>
>Thank you all

João,

A couple of ways. Easiest would be to use the Windows Script Host's FileSystemObject.
oFSO = CREATEOBJECT("Scripting.FileSystemObject")
oFolder = oFSO.GetFolder("C:\dbaccount2000")
oFolder.Name = "dbaccount2001"
If you don't have access to the WSH, you can use the API's MoveFile() function:
DECLARE INTEGER MoveFile IN Win32API;
   STRING @lpcurrentname, STRING @lpnewname
* lcoldname is the old directory name
* lcnewname is the new directory name
llresult = (MoveFile(@lcoldname, @lcnewname) # 0)
llresult will be .T. if the function succeeds.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform