打开文件的睡眠然后关闭无限循环批处理? [英] Open file sleep then close infinite loop in batch?
问题描述
我有4打开CMDS然后进入相应的这个批处理文件
文件夹,并执行一些其他的批处理文件,然后执行Python脚本。
我基本上希望有此批处理文件
:循环
启动CMD.EXE / KCD C:\\用户\\伊万\\桌面\\文件夹1&放大器;调用的run.bat
启动CMD.EXE / KCD C:\\用户\\伊万\\桌面\\文件夹2&放大器;调用的run.bat
启动CMD.EXE / KCD C:\\用户\\伊万\\桌面\\ folder3&放大器;调用的run.bat
启动CMD.EXE / KCD C:\\用户\\伊万\\桌面\\ folder4&放大器;调用的run.bat
转到循环
打开这些4 CMDS,然后等待约30分钟,关闭并重新打开它们,所以它会是这个样子。
:循环
启动CMD.EXE / K...
睡眠(1800000)
出口
转到循环
没有人知道这是否可能?
启动RunBat/ DC:\\用户\\伊万\\桌面\\文件夹1的号召的run.bat
启动的run.bat
与标题的新窗口 RunBat
的工作目录 C:\\用户\\伊万\\桌面\\文件夹1
(无需使用 CD
命令)
超时/ T 1800 GT; NUL
暂停(30分钟60秒*设)1800秒执行。 (> NUL
:不显示定时器)
最后
TASKKILL /网络连接WINDOWTITLE EQ RunBat *
杀死那里的WINDOWTITLE与 RunBat
启动所有 CMD
窗口(这样你不需要的PID) 。 (给你所有的女儿流程相同的标题,所以你可以杀死所有的人都用一个 TASKKILL
命令,或给他们唯一的冠军是能够分别杀死他们)
将一个标签和一个转到
身边,你就大功告成了。
I have this batch file which opens 4 cmds and then goes to the corresponding folder and executes some other bat files which then execute python scripts. I basically want to have this batch file
:loop
start cmd.exe /k "cd C:\users\ivan\desktop\folder1 & call run.bat"
start cmd.exe /k "cd C:\users\ivan\desktop\folder2 & call run.bat"
start cmd.exe /k "cd C:\users\ivan\desktop\folder3 & call run.bat"
start cmd.exe /k "cd C:\users\ivan\desktop\folder4 & call run.bat"
goto loop
open these 4 cmds and then wait about 30 minutes and close and open them again, so it would look something like this
:loop
start cmd.exe /k "..."
sleep(1800000)
exit
goto loop
does anyone know if this is even possible?
start "RunBat" /d "C:\users\ivan\desktop\folder1" call run.bat
starts run.bat
in a new window with the title RunBat
with the working directory C:\users\ivan\desktop\folder1
(no need for a cd
command)
timeout /t 1800 >nul
pauses the execution for (30min*60sec) 1800 seconds. (>nul
: don't show the timer)
finally
taskkill /fi "WINDOWTITLE eq RunBat*"
kills all cmd
windows where the windowtitle starts with RunBat
(this way you don't need the PIDs). (Give all your "daughter processes" the same title, so you can kill all of them with a single taskkill
command; or give them unique titles to be able to kill them separately)
Put a label and a goto
around, and you're done.
这篇关于打开文件的睡眠然后关闭无限循环批处理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!