Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rename file using parameters
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00591399
Message ID:
00591412
Views:
20
>Hello,
>
>How to write a WSH code to rename one file? Can the .VBS code take two parameters?

Simply get a object reference to the file and change its Name property like this
oFSO = CREATEOBJECT("Scripting.FileSystemObject")
oFile = oFSO.GetFile((GETFILE("*")))
? oFile.Name
oFile.Name = FORCEEXT(oFile.Name, 'DBF')
? oFile.Name
Naturally, in VBScript you'd get the object references using Set.

Why would you need two parameters?
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform