Read each character of argument in a batch file
arguments, batch-file, command-line-arguments, parameter-passing
Solution
@echo off
if "%1"=="/p" (
:LOOP
echo %2
shift
set arg=%2
if defined arg goto :LOOP else exit >nul
)
Problem
sample input in cmd: ``` test.bat /p 1,3,4 ``` expected result: ``` 1 3 4 ``` my codes so far: ``` @echo off set arg = %1 set var = %2 if (%1)==(/p) ( ... need code that will read and print each character of var ) ```