(view source code of locase.bat as plain text)
@ECHO OFF
SETLOCAL
IF [%1]==[] GOTO Syntax
ECHO %* | 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 :LoCase1 %%A
GOTO End
:LoCase1
FOR %%a IN (%*) DO CALL :LoCase2 %%a
GOTO:EOF
:LoCase2
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 LoCase.bat, Version 2.00 for Windows NT 4 / 2000
ECHO Rename specified file(s) to all lowercase
ECHO.
ECHO Usage: LOCASE ^<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.0082 seconds