PDA

View Full Version : CHANGE THE FILE NAME CASE IN WINDOWS.



nandakumar
05-05-2010, 11:42 AM
hi,
I am trying to get a batch file to change the file name to upper case. I found some code to change upper to lower. I dont know anything about coding:rotlaugh:

I am looking for two code, one is to "change file name to upper case. Example :myfile" should be "MYFILE"
another is change the starting later of file name to upper case. Example :myfile" should be "Myfile"

code to change to lower case:
@echo off
if .%1==./? (
echo Changes all filenames in the given dir to lowercase
echo.
echo %~n0 dir [/s]
echo.
echo dir The directory.
echo /s Include subdirectories of 'dir'.
goto :EOF)
setlocal
pushd %1
if .%2==. (
set DIRCMD=/L/B
echo Rename all filenames in %1 to lowercase filenames?&goto :Anykey
) else if /i .%1==./S (
set DIRCMD=/L/B/S/A-D
echo Rename all filenames in %1 and its subdirs to lowercase filenames?&goto :Anykey
) else (
echo Invalid switch: %*&goto :End)
:Anykey ---------------------------------------------------------------
for /f "tokens=*" %%F in ('dir/s') do move "%%F" "%%F"
:End ------------------------------------------------------------------
popd&endlocal&goto :EOF

Bob Phillips
05-06-2010, 02:57 AM
What do you want this done in, Excel, Word, or what?

nandakumar
05-06-2010, 10:10 AM
I want to run this .bat file on windows explorer, so it will convert the file name to upper case.

thnaks