(view source code of locase3.bat as plain text)
@ECHO OFF
:: Check Windows version -- NT 4 or later required
IF NOT "%OS%"=="Windows_NT" GOTO Syntax
:: Use local variables
SETLOCAL
:: Check command line arguments
IF "%~1"=="" GOTO Syntax
ECHO %* | FIND "/?" >NUL && GOTO Syntax
SET OK=1
:: FOR %%A IN (%*) DO IF NOT EXIST %%A IF /I NOT "%%~A"=="/S" SET OK=0
FOR %%A IN (%*) DO IF NOT EXIST %%A SET OK=0
IF "%OK%"=="0" GOTO Syntax
:: The actual command by Niels Stout uses DIR's
:: /L switch to convert filenames to lower case
FOR /F "tokens=* delims=" %%A IN ('DIR %* /B /L') DO REN "%%~A" "%%~A"
GOTO End
:Syntax
ECHO.
ECHO LoCase.bat, Version 3.00 for Windows NT 4 and later
ECHO Use DIR /L to rename specified file(s) to all lowercase
ECHO.
ECHO Usage: LOCASE filespec [ filespec [ ... ] ]
ECHO Where: filespec designates a file or group of files in
ECHO the current directory to be renamed
ECHO.
ECHO DIR /L trick by Niels Stout
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com
:End
IF "%OS%"=="Windows_NT" ENDLOCAL
page last modified: 2024-04-16; loaded in 0.0071 seconds