为了能快速了解并处理您的问题,请提供以下基础信息:
系统版本:Windows Server 2016 Datacenter (build 14393) x64 (Py3.8.6)
问题描述:设定计划任务【Bat脚本】后,脚本未能按照预期计划执行
脚本内容:netsh interface set interface "VMware Network Adapter VMnet8" admin=disable
netsh interface set interface "VMware Network Adapter VMnet8" admin=enable
宝塔生成的定时任务脚本内容:
echo ------------------------------------START--------------------------------- >> F:/BtSoft/cron/cc07a7ddb5edfae60e0dc19a31b93484.log 2>&1 & netsh interface set interface "VMware Network Adapter VMnet8" admin=disable
netsh interface set interface "VMware Network Adapter VMnet8" admin=enable >>F:/BtSoft/cron/cc07a7ddb5edfae60e0dc19a31b93484.log 2>&1 & bt get_cron_day >> F:/BtSoft/cron/cc07a7ddb5edfae60e0dc19a31b93484.log 2>&1 & echo -------------------------------------END-----------------------------------
主要错误内容为执行了disable之后无法再继续执行下一行的脚本,经过查看日志之后发现确实是无法继续往下执行。
目前已解决
解决方案是将要执行的脚本放到一个bat文件中
然后在定时任务中执行此脚本
修正后的宝塔Bat脚本内容:
call xxx.bat
希望优化一下windows的bat脚本支持,或者更改运行方案
|