Skip to content

Instantly share code, notes, and snippets.

@cfstras
Last active January 4, 2016 19:19
Show Gist options
  • Save cfstras/8666818 to your computer and use it in GitHub Desktop.
Save cfstras/8666818 to your computer and use it in GitHub Desktop.
The reason why nobody should use batch files. Found in an old batch file.
:toLower str -- converts uppercase character to lowercase
:: -- str [in,out] - valref of string variable to be converted
if not defined %~1 EXIT /b
for %%a in ("A=a" "B=b" "C=c" "D=d" "E=e" "F=f" "G=g" "H=h" "I=i"
"J=j" "K=k" "L=l" "M=m" "N=n" "O=o" "P=p" "Q=q" "R=r"
"S=s" "T=t" "U=u" "V=v" "W=w" "X=x" "Y=y" "Z=z" "Ä=ä"
"Ö=ö" "Ü=ü") do (
call set %~1=%%%~1:%%~a%%
:: it's nice how this line manages to represent the horrors of syntax in under 30 characters.
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment