Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convert file name to upper case

1,779 views
Skip to first unread message

JVS

unread,
Jul 23, 2004, 8:41:15 PM7/23/04
to
What is the easiest way to convert lower case file names to upper case?

Thanks!
jvs


Michael Bednarek

unread,
Jul 24, 2004, 12:13:27 AM7/24/04
to
On Sat, 24 Jul 2004 00:41:15 GMT, "JVS" <sir...@gte.net> wrote in
alt.msdos.batch.nt:

>What is the easiest way to convert lower case file names to upper case?

IMHO the easiest way is this, using 4NT:
REN fu.bar %@UPPER[fu.bar]

I use the opposite a lot to prepare files for uploading to a web site:
convert all filenames to lower case. I have an alias defined as:
tolower=FOR %fn IN (%1) REN "%fn" %@LOWER["%fn"]

Then, the command
tolower *.htm
will convert all filename *.htm to lower case.

4NT's function @UPPER is documented at
<http://jpsoft.com/help/f_upper.htm>; an overview of functions at
<http://jpsoft.com/help/functioncats.htm>; the alias command is
documented at <http://jpsoft.com/help/alias.htm>.

Other CLIs may require more elaborate approaches.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"

Marco Maier

unread,
Jul 24, 2004, 3:57:22 AM7/24/04
to

In pure batch probably this one:

@echo off
setlocal enabledelayedexpansion
for /f "tokens=*" %%a in ('dir /b /a-d *.txt') do (
set var=%%a
set u=ABCDEFGHIJKLMNOPQRSTUVWXYZ
set l=abcdefghijklmnopqrstuvwxyz
for /l %%b in (0,1,25) do call :u !l:~%%b,1! !u:~%%b,1!
ren "%%a" "!var!"
goto :eof
:u
set "var=!var:%1=%2!")

Mark V

unread,
Jul 24, 2004, 7:05:59 AM7/24/04
to

One such is FILECASE.EXE (free) in the "Win32 Console ToolBox 1.0 for
Windows"

Usage: filecase [/s] [/h] [/p] [/q] [/d] [/l | /u] filespec ...

/s Process subdirectories.
/h Process hidden/system files/directories.
/p Prompt for each file/directory to be renamed (Yes/No/All/Quit).
/q Quiet mode; Only display errors.
/d Rename directory names as well as file names.
/l Convert names to lowercase (default).
/u Convert names to uppercase.

http://www.stevemiller.net/apps/

Timo Salmi

unread,
Jul 26, 2004, 1:06:02 AM7/26/04
to
JVS <sir...@gte.net> wrote:
> What is the easiest way to convert lower case file names to upper case?

Easies, I don't know, but included in

ftp://garbo.uwasa.fi/pc/ts/tscmd20.zip Script file collection, T.Salmi
Filename Comment Date Time
-------- -------------------------------- ---- ----
1CMDFAQ.TXT NT/w2k/XP script tricks and tips Jun-28-2004 21:00:02
CHOOSE.EXE Ask questions in script files Dec-11-2003 06:33:38
COLORMAP.CMD Display ECHOC.EXE color map Jan-25-2004 22:41:08
DATE2NUM.EXE Date into a Julian date number Dec-09-2003 09:15:30
ECHOC.EXE Echo in colors Jan-25-2004 10:10:30
EDATE.CMD Some alternative date formats Jun-01-2004 04:04:14
FILEAGE.CMD Find out how old a file is Jan-02-2004 00:27:48
FILEINFO.CMD CMD shell for FILEINFO.VBS Feb-26-2004 08:32:56
FILEINFO.VBS FileInfo Visual Basic Script Feb-26-2004 16:09:12
FILE_ID.DIZ Brief characterization of TSCMD Nov-16-2003 10:29:00
M_TSCMD.CMD A makefile to build this package Jun-16-2004 08:14:08
NAMEDOWN.CMD Covert a filename to lower case Jun-19-2004 12:04:20 <----
NAMEUP.CMD Covert a filename to upper case Jun-19-2004 12:43:46 <----
NUM2DATE.EXE A Julian date number into a date Dec-09-2003 09:15:32
RECENT.CMD CMD shell for RECENT.VBS Feb-27-2004 09:20:46
RECENT.VBS Search folders for recent files Feb-27-2004 19:50:02
TSCMDIDX.TXT The questions index separately Jun-28-2004 21:09:58
TSCMDINF.TXT Document (a readme) for TSCMD Jun-28-2004 21:01:56
TSCMDNWS.TXT News about the TSCMD package Jun-28-2004 21:02:42
TSPROG.TXT List of programs from Timo Salmi Nov-28-2003 00:31:28
WHEREIS.CMD Find a file anywhere on a drive Feb-26-2004 09:18:26
XPMOVE.CMD CMD shell for XPMOVE.VBS Feb-29-2004 17:04:06
XPMOVE.VBS Move newer files between folders Mar-02-2004 14:35:28
---- ------ ------ -----
0023 276418

All the best, Timo

--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland
Timo's FAQ materials at http://www.uwasa.fi/~ts/http/tsfaq.html

0 new messages