(view source code of upcase.bat as plain text)
@ECHO OFF
SETLOCAL
IF [%1]==[] GOTO Syntax
TYPE %* | FIND "/?" >NUL
IF NOT ERRORLEVEL 1 GOTO Syntax
SET OK=1
FOR %%A IN (%*) DO IF NOT EXIST %%A SET OK=0
IF [%OK%]==[0] GOTO Syntax
FOR %%A IN (%*) DO CALL :UpCase1 %%A
GOTO End
:UpCase1
FOR %%a IN (%*) DO CALL :UpCase2 %%a
GOTO:EOF
:UpCase2
SET filename=%*
VER | FIND "Windows NT" >NUL
IF NOT ERRORLEVEL 1 SET filename=%filename:~1%
SET filename=%filename:a=A%
SET filename=%filename:b=B%
SET filename=%filename:c=C%
SET filename=%filename:d=D%
SET filename=%filename:e=E%
SET filename=%filename:f=F%
SET filename=%filename:g=G%
SET filename=%filename:h=H%
SET filename=%filename:i=I%
SET filename=%filename:j=J%
SET filename=%filename:k=K%
SET filename=%filename:l=L%
SET filename=%filename:m=M%
SET filename=%filename:n=N%
SET filename=%filename:o=O%
SET filename=%filename:p=P%
SET filename=%filename:q=Q%
SET filename=%filename:r=R%
SET filename=%filename:s=S%
SET filename=%filename:t=T%
SET filename=%filename:u=U%
SET filename=%filename:v=V%
SET filename=%filename:w=W%
SET filename=%filename:x=X%
SET filename=%filename:y=Y%
SET filename=%filename:z=Z%
REN %* %filename%
GOTO:EOF
:Syntax
ECHO.
ECHO UpCase.bat, Version 2.00 for Windows NT 4 / 2000
ECHO Rename specified file(s) to all uppercase
ECHO.
ECHO Usage: UPCASE ^<filespec^> [ filespec [ filespec [ ... ] ] ]
ECHO.
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com
:End
ENDLOCAL
page last modified: 2024-04-16; loaded in 0.0076 seconds