Re: How to UPCASE string in bat files?
- From: "Pegasus \(MVP\)" <I.can@xxxxxxxxxx>
- Date: Fri, 29 Feb 2008 09:35:50 +0100
"ILiya" <iliya00@xxxxxxxxx> wrote in message
news:eab%23cpqeIHA.4260@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 are no batch commands to perform this
function. You would have to examine each letter in turn and
translate it to its upper-case equivalent. A better alternative
would be to use an embedded VB Script:
@echo off
Set case=U
Set String=%CD%
echo > c:\tempVBS.vbs Set objArgs = WScript.Arguments
echo >>c:\tempVBS.vbs if objArgs.count = 0 then wscript.quit
echo >>c:\tempVBS.vbs wscript.echo %case%Case(objArgs(0))
for /F "tokens=*" %%* in ('cscript //nologo c:\TempVBS.vbs "%String%"') do
echo %%*
del c:\TempVBS.vbs
Set "case" to "U" or "L", and "String" to whatever you want
to translate.
.
- References:
- How to UPCASE string in bat files?
- From: ILiya
- How to UPCASE string in bat files?
- Prev by Date: Re: how to alphabeticaly sort files in bat file?
- Next by Date: Re: Need to know at what dattime computer boots up
- Previous by thread: How to UPCASE string in bat files?
- Next by thread: Re: How to UPCASE string in bat files?
- Index(es):
Relevant Pages
|
Loading