Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is there a way to achieve the below


A text file contains a list of sport viz Cricket, Football, Tennis

a IF command in the script that could scan these text file values, and return appropriate result (The sport details are available)


OR

something like that

A stack/structure kind of thing where a variable stores numerous values

set var = [ cricket, footbal, tennis]

if %userinput% == (cricket,football,tennis) echo selected sport kit is available
else
echo kits unavailable!
Posted
Comments
Sergey Alexandrovich Kryukov 30-Nov-15 14:45pm    
I'm just curious: what makes you using such a hard-to-use tool as batch script for the task where "real" programming would be much more suitable? You could use at least PowerShell, and, if it is not installed, at least old (majorly obsolete) Windows Script Host programming, which is always available and can be done, say, with JavaScript. Also not the best activity, but already something more realistic...

Batch is only good for the simplest tasks, and mostly for those we write for ourselves (such as build, revision control scripts, system administration chores and the like), not the users...

—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900