Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Quick question about WSH
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Quick question about WSH
Miscellaneous
Thread ID:
00473563
Message ID:
00473563
Views:
57
Hi everybody,

I'm in the middle of writting a simple program for renaming all reports in labels in one directory. So far I wrote:
********************************************************************
*  Description.......: RenameReports - rename all existing reports
*  Calling Samples...: 
*  Parameter List....: 
*  Created by........: Nadya Nosonovsky 02/07/2001 02:44:30 PM 
*  Modified by.......: 
********************************************************************
local lnRepFiles, lni, lcOldName, lcNewName, loFSO, loFolder, lcExt
*!*     lnRepFiles=adir(laReports,"*.FR?")
*!*     for lni=1 to lnRepFiles
*!*         lcOldName=laReports[lni,1]
*!*         ?lcOldName
*!*     next    
loFSO=createobject("Scripting.FileSystemObject")
loFolder=loFSO.GetFolder(curdir())
for each oFile in loFolder.Files
     lcOldName=oFile.Name
     lcExt=justext(lcOldName)
     if inlist(lcExt,"LBX","LBT","FRX","FRT") && Report or labels
        lcNewName="XS"+lcOldName
        loFso.MoveFile(
     endif
endfor
I want to keep the same file in the same directory but change the name. Can I use here loFSO.MoveFile(lcOldName,lcNewName)?
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform