How to use file contents as command-line arguments Windows

Viewed 2102

In a Bash shell I can write

some_command $(< some_file)

to pass the contents of some_file to some_command as command-line arguments. How can I best accomplish the same thing on Windows, preferably using built-in commands/syntax?

Edit: To clarify, any form of whitespace in some_file should be treated as argument separators as is the case in my Bash example. In particular, this needs to work even if some_file has multiple lines.

1 Answers
set /p ARGS= <some_file
some_command %ARGS%
Related