Search found 3 matches

by jackjack
26 Apr 2018 15:01
Forum: DOS Batch Forum
Topic: Coding issues
Replies: 7
Views: 4932

If statment

If any one is able to help me

I am using this code

Code: Select all

if NOT "%color%"=="blue" (
 GOTO :colorError
 ) else (
 echo working
 )
but I want to add green and red into the statement, how can I do this please

many thanks
by jackjack
26 Apr 2018 14:38
Forum: DOS Batch Forum
Topic: Coding issues
Replies: 7
Views: 4932

Re: Coding issues

So it will ask the user to enter a color, and it can be 6 colors but I need to make sure that it is only them 6 colors,

so they will be set in a variable already defined
by jackjack
26 Apr 2018 14:28
Forum: DOS Batch Forum
Topic: Coding issues
Replies: 7
Views: 4932

Coding issues

If anyone can help me this would be great. so I am needing to do a simple check after a user has inputted information, I only want the check to be approved if they have only entered 6 colours if not it fails. I was trying to do it in 6 different IF statements but its to clunky set /p "myVar=---> " e...