0

i want to store output of command in variable in batch programming please help me..thanks in advance..

like i want to store output of find command in variable p set p=find /c "chi*" "file.txt"

1 Answer 1

1

Assuming you want to store number of lines and not full line of output produced by find

for /f "tokens=3" %%i in ('find /c "chi*" "file.txt"') do set p=%%i 

Note: to store full line you can use either tokens=* or delims= (no space after equal sign!).

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.