Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rename file using parameters
Message
 
 
To
07/12/2001 15:28:30
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00591399
Message ID:
00591440
Views:
29
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
Previous
Reply
Map
View

Click here to load this message in the networking platform