将 .txt 中的行读入批处理文件并作为参数传递给命令行?

Reading lines from .txt into batch file and handing into command line as arguments?

我需要逐行读取 .txt 文件的每一行,将每一行作为参数提交给我在 CMD 行界面中 运行 的进程。

在命令行中它看起来像:"process c:/script.js arguments"。

我最初使用 Python:

with open("C:\path\to\document.txt", "r") as fileOpen:
lines = fileOpen.read().split("\n")
for line in lines:
    subprocess.call("someProcess C:/path/to/script.js " + line, shell=True)

然而,由于需要在没有依赖项的情况下进行分发,我现在宁愿不使用 python 来完成任务。有没有办法使用批处理文件来做到这一点?

for /f "usebackq tokens=* delims=" %%# in ("C:\path\to\document.txt") do (
    call "C:/path/to/script.js" %%#
)

?