RE: [Batch] Is it possible? 11-06-2011, 12:36 AM
#4
You Wouldnt use SET. You Would use the 'choice' Command.
------------------------------------------------------
Example:
choice /c [possible choices] /n
You Could Use 1-9 or a-z as Possible Choices.
------------------------------------------------------
To Check What Was Pressed You Use 'errorlevel'.
------------------------------------------------------
Example:
choice /c 123abc /n
if errorlevel 6 [command]
if errorlevel 5 [command]
if errorlevel 4 [command]
if errorlevel 3 [command]
if errorlevel 2 [command]
if errorlevel 1 [command]
Possible Choice "c" is the same as Errorlevel "6" Because
it is the 6th Possible Choice. Letters Always Go LAST as
Possible Choices.
-------------------------------------------------------
I Tried Explaining that the Best I Could. If Its Not clear Enough go to the CMD and Type "choice /?" (No Quotes).
------------------------------------------------------
Example:
choice /c [possible choices] /n
You Could Use 1-9 or a-z as Possible Choices.
------------------------------------------------------
To Check What Was Pressed You Use 'errorlevel'.
------------------------------------------------------
Example:
choice /c 123abc /n
if errorlevel 6 [command]
if errorlevel 5 [command]
if errorlevel 4 [command]
if errorlevel 3 [command]
if errorlevel 2 [command]
if errorlevel 1 [command]
Possible Choice "c" is the same as Errorlevel "6" Because
it is the 6th Possible Choice. Letters Always Go LAST as
Possible Choices.
-------------------------------------------------------
I Tried Explaining that the Best I Could. If Its Not clear Enough go to the CMD and Type "choice /?" (No Quotes).
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)