A
A
AirFlare2021-03-30 17:18:36
cmd/bat
AirFlare, 2021-03-30 17:18:36

How to execute a command in a command?

There is a command with many arguments:
file.exe -a /abd -b -c \way -i -z <CONTENT> -v
And here, the most interesting thing, you need to get the output of the contents of the X.txt file after the -z argument. How to do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AirFlare, 2021-04-05
@AirFlare

I implemented it like this:

set /p CONTENT=< "C:\way\file.txt"
file.exe -a /abd -b -c \way -i -z %CONTENT% -v

R
res2001, 2021-03-30
@res2001

You can filter lines in a text file using findstr.
You can split a string into tokens with for /f
See:

findstr /?
for /?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question