0

I want to take several input from user and use those input separately as a argument to call another .ttl file. for example : when i run my batch file I take user input like : 23,34,45,56,76,44 so how do i access each input like (23 or 34 or 45) separately ? as i want to call _acb.ttl file wit argument 24 and _bfc.ttl file with 34 and so on...

I want to do it inside the batch file not as an Argument.

2

1 Answer 1

0
@ECHO OFF
SETLOCAL

SET /p userinput="please enter data separated by commas or spaces "
CALL :getarg 1
ECHO arg 1 is %argument%
CALL :getarg 3
ECHO arg 3 is %argument%
CALL :getarg 2
ECHO arg 2 is %argument%

GOTO :EOF

:getarg
CALL :nabarg %1 %userinput%
GOTO :eof

:nabarg
SETLOCAL
SET num=%1
:nabargl
SHIFT
IF %num% neq 1 SET /a num-=1&GOTO nabargl
endlocal&SET argument=%1
GOTO :eof

Simple!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.