Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rename file using parameters
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00591399
Message ID:
00591440
Vues:
31
This message has been marked as the solution to the initial question of the thread.
Dim oFSO, oArgs, oFile
Dim cOldFile, cNewName

SET oFSO  = CREATEOBJECT( "Scripting.FileSystemObject" )
SET oArgs = Wscript.Arguments

cOldFile = oArgs( 0 )
cNewName = oArgs( 1 )

SET oFile = oFSO.GetFile( cOldFile )
oFile.Name = cNewName
Something like that should work, although you may want to make sure the file exists first. First parameter is full path and file name, second parameter is the new file name. Good luck. By the way, this was modified from what George already posted, thanks George.
jfh
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform