Vous êtes sur la page 1sur 10

signup

SuperUserisaquestionandanswersiteforcomputerenthusiastsandpowerusers.It's100%free,noregistration
required.

login

windowsHowcanImassrenamefiles?SuperUser

6/18/2015

tour

help

Takethe2minutetour

HowcanImassrenamefiles?

I'vegotabunchoffilesnamedwithathepattern
DescriptiveName.txt .

99DescriptiveName.txt

andI'dliketoremovethenumberfromthefrontsoIjusthave

HowcanIdothis?CanIdoitfromthecommandlineoristhereautilitythatcandothis?
windows commandline filemanagement

communitywiki
9revs,5users67%
CodeSlave

editedSep28'14at0:22

5 Doyoureallymeandos,orthewindowscommandprompt?therefromhereJul30'09at20:52

22Answers

Iknowinyourtitleyousay"indos"butIgettheimpressionyouarejustlookingforawaytodo
thisandarewonderingifthatisthebestway.
TheabsolutebesttoolIhavefoundforthisisBulkRenameUtility .

Itisn'tacommandlinetool,buttheydohaveacommandlineversionifyoureallywanttouseit
thatway.
I'veusedtheGUIversionalot,anditisverypowerful,veryfastandextremelyeasytouse.
Oh,anditisFREE(Latestupdateincludesnonintrusiveadsandanoptiontopayandremove
them.)
editedJan12'12at16:43

communitywiki
3revs,2users94%
JimMcKeeth

http://superuser.com/questions/16007/howcanimassrenamefiles

1/10

6/18/2015

windowsHowcanImassrenamefiles?SuperUser

49 Wow,that'ssomeinterface.Lookslikeit'dbehappyinoneoftheWorstGUIthreads.Pauk Jul30'09at
22:22
3

Iconcur,thatisoneoftheworstUI'sI'veeverseen.JohnFx Jul31'09at18:46

IsawthatGUIandimmediatelythought"Thatwouldbemuchmoreuserfriendlyasaconsoleapp"
GrantAug7'09at17:42

16 IfiguredthisistheUIequivalentofaregularexpression.Itlooksterrible,butitgetsthejobdone.
JimMcKeethAug9'09at2:50
9

BetteraGUIthatshowsyouallyouroptionsthanaconsoleappthatmakesyoumemorizeallthose
optionsandrequiresyoutoreadamanualbeforeyoucanuseit.endolithJan12'12at6:04

AsmallPowerShellscript:
$args|RenameItemNewName{$_.Name.ToLower()replace'\d+'}

Combinedwithmorecomplexregularexpressions,thismightbecomesomethinglike:
ls|RenameItemNewName{$_replace'(\d+)(.*).mp3','$2$1.mp3'}

Whichturnsthingslike'01Beginning.mp3'into'Beginning01.mp3'.
Usethe

WhatIf

parameteron

RenameItem

tocheckrenamesbeforeyouissuethem.

editedJan14'14at9:49

communitywiki
4revs,2users50%
sysrqb

1 @sysrqb,pleaseresearchalittlemore.Joey Jan14'14at9:51

Ifyoureallywanttousethewindowscommandline(ifyoudon'twanttodownloadsomething),
youcoulddoitlikethis:
dir/B>fileList.txt
for/f"tokens=1,2,3"%iin(fileList.txt)DOren"%i%j%l"%l

ThefirstlineoutputsthelistoffilesintoafilecalledfileList.txt.Thesecondlineseparateseachof
thenamesinthelistinto3parts,the#,the""andtherestofthename.Foreachofthoseitdoes
therenamecommand.
answeredAug7'09at17:53

communitywiki
zdan

AntRenamerdoesaprettygoodjob(withaGUI).
Ilikethatit'squiteeasytodefineapatternofrenamingthereareplentyofonesalreadyprepared
(anditgivesapreviewoftheactions):

http://superuser.com/questions/16007/howcanimassrenamefiles

2/10

6/18/2015

editedAug18'11at13:36

windowsHowcanImassrenamefiles?SuperUser

communitywiki
2revs,2users89%
Gnoupi

oldschool:
YoucandoaDIRandredirecttheoutputtoafile,asinDIR*.TXT>TEMP.BAT
Thenuseaneditortotakeoutwhatyoudon'tneedandmodifythepartsyoudoneed.Addan
"@echooff"asthetopline,saveitandrunit.
editedAug7'09at18:05

communitywiki
2revs
WireGuy

1 +1Ifyoudon'tneedtodothisonaregularbasis,thisiscool.Ididn'teventhinkofthat!EvilChookieJul
30'09at21:54

Anotheroption:MassiveFileRenamer
Thissoftwarewillallowyoutoeasilyrenamemultiplefiles.It'sveryfastandsimple!
Seeitinaction:

http://superuser.com/questions/16007/howcanimassrenamefiles

3/10

6/18/2015

editedSep28'14at0:02

windowsHowcanImassrenamefiles?SuperUser

communitywiki
4revs,2users82%
IvanRF

ThetoolthatI'vebeensatisfiedwithisReNamer.Itsupportsalsothesavingofrenamingrules,
whichhasbeenusefultome,asImanytimesdothesamerenamings.
Belowisanexampleofhowtodeletetextbeforethefirstdash,butthereareloadsofotherrules
youcandefine.

editedMar4'14at7:31

communitywiki
2revs,2users60%
EskoLuontola

http://superuser.com/questions/16007/howcanimassrenamefiles

4/10

6/18/2015

windowsHowcanImassrenamefiles?SuperUser

IuseTotalCommander'smultirenametool(ctrl+M)forthingslikethis.Theirusefultool,oneof
toomanytocount,iseasytouse,andcanalsoemployregularexpressionsandtemplatesif
necessary.Oh,anditobviouslygivesyouapreviewbeforemakinganychanges.
ThisisthethirdorfourthquestionI'veansweredrecommendingTotalCommander...Ishouldbe
gettingacommissionfromthem)
communitywiki
Yuval

answeredAug23'09at8:56

I'veusedFreeCommanderPortable(freeware)forthisto
goodeffect:
1. SelectorNavigatetothefilesordirectoriestorename
2. Press[CtrlM](orFile>Multirename)
3. filloutthefieldsasmakessenseforyourcircumstance
4. verifythepreviewshowswhatyouexpect
5. Go!
communitywiki
mattwilkie

answeredNov27'09at23:02

TheeasiestwaywouldbetouseRenameMaster.
communitywiki
KevinPanko

answeredJul30'09at20:37

Here'sacommandlinesolutionaJavaprogramIwrotespecificallytomakeiteasytowork
with"patterns"infilenames.It'sfreeandopensource,sofeelfreetomodifyit:
RenameWand
http://renamewand.sourceforge.net/
Somerelevantusageexamples:
Dropeverythingbeforethe

""

inthefilename:

javajarRenameWand.jar"<a><b>""<b>"

Prependa3digitnumbertothefilename,sortingbylastmodifiedtime:
javajarRenameWand.jar"<a>""<3|#FT><a>"

Rearrangepartsofthefilename,andchangecase:
javajarRenameWand.jar"<album><artist><song>.<ext>"
"<artist.upper><album.title><song>.<ext.lower>"

answeredAug23'09at6:16

communitywiki
ZachScrivena

IdiscoveredRenPhoric aboutamonthago.Superb.Andit'sfree.
NocomplicatedinterfaceandIwasquicklyabletorenameexactlyasIwanted.Regular
Expressioncapable.Haven'tusedanythingelsesince.
answeredAug23'09at9:31

communitywiki
UmberFerrule

http://superuser.com/questions/16007/howcanimassrenamefiles

5/10

6/18/2015

windowsHowcanImassrenamefiles?SuperUser

IlikeCylogsWildRename.Itispowerful,yeteasytouse,andhasalotoffeatures:
1. fast
2. stringmanipulation
3. counters
4. wildcards
5. regularexpressions
6. substitution
7. caseconversion
8. logging
9. simulation(showtheresultswithoutactuallyapplyingthem)

answeredAug14'11at16:27

communitywiki
Synetech

MultirenamescriptisaopensourcealternativetoTotalCommandersMultiRenametoolwhich
youcoulddriveviascript.ItcanuseTCpluginsformetadatainformation.
https://code.google.com/p/multirenamescript/

answeredNov4'13at9:58

communitywiki
majkinetor

@echooff

http://superuser.com/questions/16007/howcanimassrenamefiles

6/10

6/18/2015

windowsHowcanImassrenamefiles?SuperUser

setlocalenabledelayedexpansion
setX=5
setFOLDER_PATH=.
pushd%FOLDER_PATH%
for%%fin(*)doif%%fneq%~nx0(
set"filename=%%~nf"
set"filename=!filename:~%X%!"
ren"%%f""!filename!%%~xf"
)
popd

savethisinabatchfileandrun
answeredJul4'14at5:53

communitywiki
bbm123

Like@zdanabove,Ididthisbycommandline(using"cmd.exe"inWindows).Ittooksome
tinkeringformyparticularcase,butalittleresearchsolvedit.
Likezdan,IoutputthelisttoaTXTfile,thenused tokens and delims torenamethefiles
accordingly.Inmycase,Istartedoutwithalistoffilesnamedlikeso:
name01022012.csv

Iwantedthefiledateportiontobeiny/m/dorder,withthe"name"partattheendsoitwouldread
likethis:
20120102name.csv

Todothisenmasse,Iusedthefollowingcode.Notethatwhendoingitthisway,ALLpartsofthe
filenameareconsidered,includingtheextensionof".csv".Thatgoofedmeupthefirsttime
around.
dir/B>fileList.txt
for/f"tokens=1,2,3,4,5delims=."%iin(fileList.txt)DOren"%i%j%k%l.%m"%l%j%k
%i.%m

The tokens arethe"parts"ofthefilename,the


Ihad2delimiters(adashandadot).

delims

aretheseparators.Notethatinmycase,

Ipersonallydon'tcareforthe"BulkRename"app.Asothershavementioned,theGUIis
atrociousandnotveryintuitive.Withalittleresearchandsimplecoding,thesethingscanbedone
muchmroeefficientlyandquickly.
answeredSep10'12at15:11

communitywiki
gtr1971

Foradvancedusersanddevelopers,IwouldsuggestRegexRenamer.

Pro's:
http://superuser.com/questions/16007/howcanimassrenamefiles

7/10

6/18/2015

windowsHowcanImassrenamefiles?SuperUser

VerysimpleUI
Regularexpressionsthatthedevelopersfamiliarwith
GPLv2
Con's:
It'snotacommandline!:)
answeredJan3'13at10:47

communitywiki
bytebuster

IuseBlackboardtoadministercoursesinaUniversity.WhenIdownloadanassignmentinmass
(inBlackboard,clicktopofgradingcolumn,then"assignmentfiledownload"Blackboardaddsa
bunchofextrastufftothefilenameoftenmakingthefilenametoolongtobevalidonWindows.
Here'swhattheylooklike:
Recitation20Assignment_studentname_attempt_20130301200309_Exercise28129.docx

AndthisiswhatIwanted
studentname.docx

SoIusedtheapproachthat@zdanand@gtr1971advised,byopeningacommandwindowon
thefolderwiththefilesinside(CMD.EXE).Thenrunthiscommandtoputallfilenamesina
document.
dir/b>filelist.txt

Editthedocumentandremovefoldernames,etc.
UsethiscommandtoreplacetheBlackboardaddedfilenamestuffwithjusttheusernameandfile
extension.
for/f"tokens=1,2,3,4,5,6delims=_."%iin(filelist.txt)doren"%i_%j_%k_%l_%m.%n"
%j.%n

Hopethishelpssomeoneelseaswell.
answeredMar2'13at20:08

communitywiki
Webmentorman

Funnynameandcommandlinetoolverypowerful,veryfastandextremelyeasytouse."Find
AndReplaceText"FARThttp://fartit.sourceforge.net/WORKSGREAT!canrenamewordsintxt
filestoo.

USAGE
Usage:FART[options][]<wildcard>[,...][find_string][replace_string]
Options:
hhelpShowthishelpmessage(ignoresotheroptions)
qquietSuppressoutputtostdio/stderr
VverboseShowmoreinformation
rrecursiveProcesssubfoldersrecursively
ccountOnlyshowfilenames,matchcountsandtotals
iignorecaseCaseinsensitivetextcomparison
vinvertPrintlinesNOTcontainingthefindstring
nlinenumberPrintlinenumberbeforeeachline(1based)
wwordMatchwholeword(usesCsyntax,likegrep)
ffilenameFind(andreplace)filenameinsteadofcontents
BbinaryAlsosearch(andreplace)inbinaryfiles(CAUTION)
CcstyleAllowCstyleextendedcharacters(\xFF\0\t\n\r\\etc.)
cvsSkipcvsdirs;execute"cvsedit"beforechangingfiles
aadaptAdaptthecaseofreplace_stringtofoundstring
bbackupMakeabackupofeachchangedfile
ppreviewDonotchangethefilesbutprintthechanges

editedMar30'13at20:44

communitywiki
2revs,2users92%
slm

http://superuser.com/questions/16007/howcanimassrenamefiles

8/10

6/18/2015

windowsHowcanImassrenamefiles?SuperUser

Here'sanothersimpleprogramcalledFileAttributeChangerthatyoucanusetorenamefiles.It's
aportableprogram,soyoucancarryitonaUSBdrive.
http://www.softpedia.com/get/DesktopEnhancements/OtherDesktopEnhancements/File
AttributeChanger.shtml
communitywiki
Brian

answeredJul10'13at23:07

IhavedevelopedahybridJScript/batchcommandlineutilitycalledJREN.BATthatcanrename
filesorfoldersbyperformingaregularexpressionsearchandreplaceonthenames.Itispure
scriptthatwillrunnativelyonanyWindowsmachinefromXPforward.Fulldocumentationis
embeddedwithinthescript.
AssumingJREN.BATisinyourcurrentdirectory,orbetteryet,somewherewithinyourpath,then
yourrenametaskbecomestrivial.
jren"^\d+[]+(.+)\.txt$""$1"/i

or
jren"^\d+[]+(?=.+\.)"""/fm"*.txt"

Therearemanyoptions,includingthe
directories.
answeredDec1'14at2:56

/S

optionthatrecursivelyperformstherenameonsub

communitywiki
dbenham

Ifyouneedseriouspowerandarewillingtoshelloutthemoney...PowerGrepisoneofthemost
powerfulandversatiletoolsonthemarket...youcanrenamealmostanythingwithPowerGrep...
evenbinarysearchandreplace...it'screatedbyRegExGuru,JanGoyvaerts .

answeredMar18at0:47

communitywiki
EddieB

http://superuser.com/questions/16007/howcanimassrenamefiles

9/10

6/18/2015

windowsHowcanImassrenamefiles?SuperUser

protectedbyCommunity Dec30'14at21:47
Thankyouforyourinterestinthisquestion.Becauseithasattractedlowqualityanswers,postingananswernowrequires10reputationonthissite.
Wouldyouliketoansweroneoftheseunansweredquestions instead?

http://superuser.com/questions/16007/howcanimassrenamefiles

10/10

Vous aimerez peut-être aussi