Re: how to upcase in the bat file?




"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.


.



Relevant Pages

  • Re: "Dollhouse" = Duh-house
    ... He ripped through the Dollhouse, sparing Echo ... emergence of Echo as a character. ... original personality doesn't make it so. ...
    (rec.arts.tv)
  • Re: "Dollhouse" = Duh-house
    ... He ripped through the Dollhouse, sparing Echo ... emergence of Echo as a character. ... original personality doesn't make it so. ...
    (rec.arts.tv)
  • Re: trying to recursively get the files owners and permissions as well as an md5sum of the data
    ... memory taxing", which are both measurable, but "better" because md5sum is ... The NUL character is the one character that cannot ... xargs -0 tells xargs to split it's ... Here, as the cmd is not provided, xargs calls the "echo" command ...
    (comp.unix.shell)
  • Re: "Dollhouse" = Duh-house
    ... He ripped through the Dollhouse, sparing Echo ... emergence of Echo as a character. ... original personality doesn't make it so. ...
    (rec.arts.tv)
  • Re: Question about RS232 compatibility
    ... some modem setups automatically assume full sync operation/ others will take shortcuts and "leave out" some handhsake signals to ... to hardware devices can be picky and truly unforgiving. ... I use an echo character scheme where the sending device ... for some reason the echo just breaks down. ...
    (microsoft.public.vb.general.discussion)