1.

Solve : Making upper case text in batch files?

Answer»

Hi,

I have a batch file with names like "EvoTech". I was wondering if there is any command that can make all the words uppercase. If some command option with SET or ECHO available or any other please let me know.

Thanks,
Hussain
There is no such command in batch files, at least not as far as I know.

Please give me a little more information:

(1) Do you want to do the case changes during runtime? What this MEANS is that do you want to keep the file as is, but only display it in capitals when you run the file?

(2) Do you want to edit the file and change everything to capitals and then run the file?

For #1, I doubt you will find a solution, but for #2, there are several decent freeware editors available that can transform case for you, for example conTEXT. You can find it at: http://www.fixedsys.com/context/

Regards,

FolkLore
I upload those files to server. So basically YES, I want the "EvoTech" to be "EVOTECH" at runtime when it is uploaded to the server, don't CARE about the original.

Thanks,
Hussain
As I said - I doubt you will find an easy solution for when you want to change it only during runtime, but if you can edit it before hand it would be simple, right?

USE the text-editor I recommended earlier - conTEXT.

Regards,

FolkLore
Thanks a lot. I found a WAY of doing it using the following batch file.

SET ToUpper=%1
IF [%ToUpper%]==[] GOTO Ending
SET ToUpper=%ToUpper:a=A%
SET ToUpper=%ToUpper:b=B%
SET ToUpper=%ToUpper:c=C%
SET ToUpper=%ToUpper:d=D%
SET ToUpper=%ToUpper:e=E%
SET ToUpper=%ToUpper:f=F%
SET ToUpper=%ToUpper:g=G%
SET ToUpper=%ToUpper:h=H%
SET ToUpper=%ToUpper:i=I%
SET ToUpper=%ToUpper:j=J%
SET ToUpper=%ToUpper:k=K%
SET ToUpper=%ToUpper:l=L%
SET ToUpper=%ToUpper:m=M%
SET ToUpper=%ToUpper:n=N%
SET ToUpper=%ToUpper:o=O%
SET ToUpper=%ToUpper:p=P%
SET ToUpper=%ToUpper:q=Q%
SET ToUpper=%ToUpper:r=R%
SET ToUpper=%ToUpper:s=S%
SET ToUpper=%ToUpper:t=T%
SET ToUpper=%ToUpper:u=U%
SET ToUpper=%ToUpper:v=V%
SET ToUpper=%ToUpper:w=W%
SET ToUpper=%ToUpper:x=X%
SET ToUpper=%ToUpper:y=Y%
SET ToUpper=%ToUpper:z=Z%
:Ending

Hussain
Excellent - now I have learned something myself!

Regards,

FolkLore



Discussion

No Comment Found