【发布时间】:2023-03-14 23:21:02
【问题描述】:
我有 test_run.bat 文件被安排在指定的时间和日期运行。我已使用以下命令将其添加到任务调度程序中:
set testfile=%%~dp0%test_run.bat release
schtasks /create /tn "test_run" /tr "%testfile%" /sc weekly /d * /mo 1 /st %tt% /sd %dd%
我打算在这里运行“test_run.bat”,并以“release”作为参数。当此任务启动时,它会在后台运行。我希望它打开一个新的命令窗口(从该批处理文件所在的文件夹开始)并运行该批处理文件。
我怎样才能做到这一点?上面提到的两行是否正确(考虑释放作为参数)?
使用开始:
set testfile=start /c %%~dp0%test_run.bat release
schtasks /create /tn "test_run" /tr "%testfile%" /sc weekly /d * /mo 1 /st %tt% /sd %dd%
我说的对吗?
【问题讨论】:
标签: windows scheduled-tasks batch-file