User Tools

Site Tools


windows_batch_scripting

This is an old revision of the document!


Windows Batch Scripting

The Wikibook

Tricks

How to find if a string is in a list of strings in a DOS batch file

from http://stackoverflow.com/questions/11235153/how-to-find-if-a-string-is-in-a-list-of-strings-in-a-dos-batch-file

setlocal EnableDelayedExpansion

set arg[1]=validArgument1
set arg[2]=validArgument2
set arg[3]=validArgument3

for /L %%i in (1,1,3) do if /I "%1" equ "!arg[%%i]!" SET "ARG=!arg[%%i]!"
windows_batch_scripting.1426149467.txt.gz · Last modified: by zertrin