right click rename-- get rid of spaces convert to lowecase...

J

John Jay Smith

Is there a tool that enables you to right click on a file on windows
explorer
and rename it so that all the spaces are replaced by a dash _ or a dot .
and all letters are converted to lowercase?

I am asking about this because I would like to upload them to a FTP
server and I want the link to be correct and not broken.

I could do it manualy but I do this all the time.. thanks

--
Disclaimer: This info is given "as is".
If you do not like the content or attitude of my posts,
please put me on your ignore list or dont read my posts.

--
 
P

Pegasus \(MVP\)

John Jay Smith said:
Is there a tool that enables you to right click on a file on windows
explorer
and rename it so that all the spaces are replaced by a dash _ or a dot .
and all letters are converted to lowercase?

I am asking about this because I would like to upload them to a FTP
server and I want the link to be correct and not broken.

I could do it manualy but I do this all the time.. thanks

I don't think you can do this in Explorer but you can do it
with a batch file. Try this:
1. Copy and paste the lines below into a notepad session.
Do not retype them - it won't work!
2. Remove Linexx from each line.
3. Save the file as c:\Windows\SuppressSpaces.bat. Make sure
you don't end up with SuppressSapces.bat.txt!
4. Open a Command Prompt (Start / Run / cmd {OK}).
5. Navigate to the folder where your files reside.
6. Type this command: SuppressSpaces {Enter}.
7. When happy with the result, remove the word "echo" from
Line9 to activate the batch file.

Line1 @echo off
Line2 echo.
Line3 echo Renaming files
Line4 setlocal enabledelayedexpansion
Line5 dir /b *.txt > c:\dir.txt
Line6 for /F "tokens=*" %%* in (c:\dir.txt) do (
Line7 set old=%%*
Line8 set new=!old: =_!
Line9 if not "!old!"=="!new!" echo ren "!old!" "!new!"
Line10 )
Line11 del c:\dir.txt
Line12 endlocal
 
P

Pegasus \(MVP\)

John Jay Smith said:
Is there a tool that enables you to right click on a file on windows
explorer
and rename it so that all the spaces are replaced by a dash _ or a dot .
and all letters are converted to lowercase?

I am asking about this because I would like to upload them to a FTP
server and I want the link to be correct and not broken.

I could do it manualy but I do this all the time.. thanks

As an afterthought, here is a slightly simpler set of instructions:

1. Copy and paste the lines below into a notepad session,
including Line13. Do not retype them - it won't work!
2. Remove Linexx from each line.
3. Save the file as SuppressSpaces.bat in the folder where the
files reside that you wish to rename. Make sure you don't
end up with SuppressSapces.bat.txt!
4. Use Explorer or My Computer to navigate to the folder
where your files reside.
5. Double-click "SuppressSpaces.bat".
6. When happy with the result, remove the word "echo" from
Line9 to activate the batch file.

Line1 @echo off
Line2 echo.
Line3 echo Renaming files
Line4 setlocal enabledelayedexpansion
Line5 dir /b *.txt > c:\dir.txt
Line6 for /F "tokens=*" %%* in (c:\dir.txt) do (
Line7 set old=%%*
Line8 set new=!old: =_!
Line9 if not "!old!"=="!new!" echo ren "!old!" "!new!"
Line10 )
Line11 del c:\dir.txt
Line12 endlocal
Line13 pause
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top