#178576 - 2007-07-31 04:10 PM
Re: Bulk rename files
[Re: Witto]
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Can this help you?
;************************************************************************* ; Script Name: Find-_AC-Files ; Author: green78 ; Date: 31/07/2007 ; Description: Find and rename files with _AC in directory ;*************************************************************************
;Script Options If Not @LOGONMODE Break On Else Break Off EndIf Dim $RC $RC = SetOption("Explicit", "On") $RC = SetOption("NoMacrosInStrings", "On") $RC = SetOption("NoVarsInStrings", "On") If @SCRIPTEXE = "KIX32.EXE" $RC = SetOption("WrapAtEOL", "On") EndIf
;Declare variables Dim $arrFiles, $strFile Dim $strPath Dim $strPrefix, $intPrefixLength
;Initialize variables $strPath = "C:\Test\Test\" $strPrefix = "BG_STAT_" $intPrefixLength = Len($strPrefix)
;Code $arrFiles = DirPlus($strPath,"/M _AC") For Each $strFile in $arrFiles ;$strFile.Name ? ;$strFile.Path ? ;$strFile.ParentFolder ? If Not Left($strFile.Name,$intPrefixLength) = $strPrefix $strFile.Move($strFile.ParentFolder + "\" + $strPrefix + $strFile.Name) EndIf Next
;UDF Section ;Copy the DirPlus UDF here |
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|