find and replace ultra with extra in files

June 3, 2009 at 21:40:23
Specs: Windows XP
find and replace "ultra" with extra in files and forders names
i want a batch file that search for all files and forlders for find and replace "ultra" to "extra" in folders and files names
can you help me?

See More: find and replace ultra with extra in files

Report •

June 3, 2009 at 22:19:24
if you have Python on Windows

import os
import  fileinput
for r,d,f in os.walk(path):
    for files in f:
        if "ultra" in files:
            os.rename( os.path.join(r,files) , os.path.join(r,newfile) )

save the script as and on command line
c:\test> python

Report •

June 7, 2009 at 06:37:48
ok i write something myself but it's not working
can you help me to make it right?

@echo off
for /f "delims=" %%a IN ('dir *ultra*.??? /s /b /on') do call :rename "%%a"
set string=%1
set string=%string:ultra=extra%
ren %1 %string%

Report •

Related Solutions

Ask Question