Re: how to upcase in the bat file?
- From: "Pegasus \(MVP\)" <I.can@xxxxxxxxxx>
- Date: Tue, 19 Feb 2008 09:12:05 +0100
"ILiya" <iliya00@xxxxxxxxx> wrote in message
news:%23PbmdrscIHA.1184@xxxxxxxxxxxxxxxxxxxxxxx
For example %cd% returns the current path. How to make what %cd% returns be
all in the upper or in lower case?
Thanks
==========
Unfortunately there is no function in batch files to do this, other
than examining each character in turn an translating it if necessary
(which is very slow and very clumsy). You could use one of the
many freeware tools that float about or you could do it with this
VB Script tool:
#@echo off
#set mode=UCase
#rem set mode=LCase
#call :Upper "%cd%"
#echo new string=%UpperString%
#goto :eof
#
#:Upper
#echo > c:\upper.vbs Set objArgs = WScript.Arguments
#echo >>c:\upper.vbs wscript.echo %mode%(objArgs(0))
#for /F "tokens=*" %%* in ('cscript.exe //nologo c:\upper.vbs %*') do set
UpperString=%%*
#del c:\upper.vbs
Note this:
- You must set the mode to UCase or LCase.
- You must remove all # characters. Their only purpose is to mark the
start of each line, in case they wrap around.
.
- References:
- how to upcase in the bat file?
- From: ILiya
- how to upcase in the bat file?
- Prev by Date: Re: Could use some help on the Blue Screen of Death
- Next by Date: Re: cannot access data files
- Previous by thread: how to upcase in the bat file?
- Next by thread: Re: Lsass.exe-System Error
- Index(es):
Relevant Pages
|