如何从命令提示符批处理文件向 WSL 传递参数?
How to pass arguments to WSL from a command prompt Batch File?
我正在尝试制作执行以下操作的批处理文件:
- cd 到我电脑中的特定目录。
- 进入WSL Ubuntu.
- 运行 带有一些参数的二进制文件。
- 关闭命令提示符终端。
我写了一个小的测试批处理文件。它尝试执行指定的操作。唯一的问题是,一旦它打开 bash 终端(在同一个 window 中),它将不会执行下一行,直到我手动 'exit' 退出 WSL,然后将尝试 运行 './PESQ' 行错误(应该是)。
cd C:/users/jesus/desktop/source/audio
::desired path
bash
::this opens up an ubuntu terminal like session inside CMD
./PESQ
::this is the compiled file, besides, there are more arguments that need to be in that line, (+16000 speech.wav speech_bab_0dB.wav)
pause
当运行编译代码时,我得到以下输出
C:\Users\jesus\Desktop\source\audio>bash
jesusb@LAPTOP-08IGLCO1:/mnt/c/Users/jesus/Desktop/source/audio$
一旦我输入 exit
我得到以下输出
C:\Users\jesus\Desktop\source\audio>./PESQ
'.' is not recognized as an internal or external command, operable program or batch file.
C:\Users\jesus\Desktop\source\audio>pause
Press any key to continue . . .`
如何将 ./PESQ +16000 speech.wav speech_bab_0dB.wav
命令发送到 bash 终端?
不要使用 bash
,而是在批处理文件中使用 wsl
命令:
wsl ./PESQ +16000 speech.wav speech_bab_0dB.wav
我正在尝试制作执行以下操作的批处理文件:
- cd 到我电脑中的特定目录。
- 进入WSL Ubuntu.
- 运行 带有一些参数的二进制文件。
- 关闭命令提示符终端。
我写了一个小的测试批处理文件。它尝试执行指定的操作。唯一的问题是,一旦它打开 bash 终端(在同一个 window 中),它将不会执行下一行,直到我手动 'exit' 退出 WSL,然后将尝试 运行 './PESQ' 行错误(应该是)。
cd C:/users/jesus/desktop/source/audio
::desired path
bash
::this opens up an ubuntu terminal like session inside CMD
./PESQ
::this is the compiled file, besides, there are more arguments that need to be in that line, (+16000 speech.wav speech_bab_0dB.wav)
pause
当运行编译代码时,我得到以下输出
C:\Users\jesus\Desktop\source\audio>bash
jesusb@LAPTOP-08IGLCO1:/mnt/c/Users/jesus/Desktop/source/audio$
一旦我输入 exit
我得到以下输出
C:\Users\jesus\Desktop\source\audio>./PESQ
'.' is not recognized as an internal or external command, operable program or batch file.
C:\Users\jesus\Desktop\source\audio>pause
Press any key to continue . . .`
如何将 ./PESQ +16000 speech.wav speech_bab_0dB.wav
命令发送到 bash 终端?
不要使用 bash
,而是在批处理文件中使用 wsl
命令:
wsl ./PESQ +16000 speech.wav speech_bab_0dB.wav