Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Batch remove %20 from filenames
Name: ovdp Date: February 10, 2006 at 09:58:07 Pacific OS: Win xp CPU/Ram: centrino 1.7 / 1024 ram Product: intel
Comment:
Hello,
I have a lot of files which countain %20 in their names. So I would like to remove %20. I have a Batch Dos script which remove spaces in filenames. Could you help me to adapt it? I would be very happy! Thanks
Name: dtech10 Date: February 10, 2006 at 13:23:26 Pacific
Reply:
Hi @echo off setlocal EnableDelayedExpansion
rem Change path as required /s All files dir /b /s | find "%%20" > Files.txt
for /f %%a in (Files.txt) do ( set FName=%%a set FName=!FName:%%20=! rem Tryed using Rename but did'nt work rem must be something to do with the % rem delimeter, so used copy then delete. copy %%a !FName! > nul del %%a > nul ) echo Done! setlocal
0
Response Number 2
Name: shahramsh Date: February 17, 2006 at 17:24:58 Pacific
Reply:
howabout
@echo off setlocal EnableDelayedExpansion for /f "delims=" %%I in ('dir /b ^| find "%20"') do ( set var01=%%I set var02=!var01:%%20=! call :ren ) :ren ren %var01% %var02%
Summary: I am new at this so forgive my ugly batch script (it's just plain old windows batch scripting language) . I am trying to normalize user input so that directory path entered by user would end up withou...
Summary: Hi, I am wondering how I might go about removing all numbers from all the files in a directory (and how I might exclude certain files from this rename which are named in a exclude.txt in the same dire...
Summary: This will accomodate up to 5 tokens. You can strecth to fit. ::== par4date.bat :: get date str into var from filename with _ delim :: the next section generates files to work with @echo off type nul ...