0

I have a curstom command that is an query language interpretor. And the file contains some queries to execute.

I want to execute this custom command by passing the whole file content as parameter with a single command.

For exemple somethink like :

myCustomCmd %type params.txt%

Is it possible ?

Thanks

1

1 Answer 1

1
for /f "usebackq delims=" %%a in ("params.txt") do myCustomCmd %%a

should draw that line from the file and use it as a parameter for you command.

Had you given us a context, I'd be able to provide more information.


Ah - you want "the entire file content" as the parameter - a requirement you edited-in five minutes after I'd posted this response...

@echo off
setlocal enabledelayedexpansion
set "params="
for /f "usebackq delims=" %%a in ("params.txt") do set "params=!params! %%a"
myCustomCmd %params%

That should fix the problem - in the absence of an example params.txt file.

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

2 Comments

I like to pass the whole file content as parameter at once.
Sorry for that misstake. Thanks it solve my problem.

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.