我在需要通过Windows Task Scheduler运行的批处理文件中具有以下内容。这是一个示例脚本。
@echo off
echo This is parent command prompt
<some external executable with some arguments> & REM This launches another command prompt with special environment variables set
REM I want the following command to be run in the command prompt that got launched above
echo This is child command prompt
如何在启动的命令提示符中运行上述最后的命令?
OR
我独立启动子命令提示符并保持运行。将要运行的命令放在批处理文件的该命令提示符下。编写更多批处理代码,以某种方式标识该子命令提示符并在该子命令提示符中执行命令。也不知道该怎么做。
以下是一个简单的例子,用以说明我的意思
@echo off
echo This is parent command prompt
start cmd.exe @cmd /k "echo hello" & REM This launches another command prompt
REM I want the following commands to be run in the command prompt that got launched above
echo This is child command prompt