Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Quick question about WSH
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00473563
Message ID:
00473568
Vues:
15
Ok, it works fine.

>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform