无尽的时间,能循环 [英] Endless time-able loop

查看:181
本文介绍了无尽的时间,能循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何创建一个运行所有的时间一个批处理文件,但只执行了我想在半夜做了什么?我知道该怎么做环部分..或因此,我认为,我从来没有做过一批code编程之前,所以我真的不知道,如果它的权利。

How do I create a batch file that runs all the time, but only performs what I want done at midnight? I know how to do the loop part.. or so I think, I've never done batch code programming before so I don't really know if its right.

:loop
Stuff
goto loop

但我需要的的东西来一个python脚本每天在午夜运行。感谢提前任何帮助!

But I need the stuff to run a python script everyday at midnight. Thanks for any help in advance!

推荐答案

这取决于显示24小时时间系统时间。
时间格式可以是可变的 - 你必须检查回声%的时间%显示时,它的午夜

This depends on the system time showing 24 hour time. The time format could be variable - you'd have to check what echo %time% shows when it's midnight.

@echo off
:loop
if "%time:~0,5%"==" 0:00" (
    echo launch python script.
    ping -n 60 localhost >nul
 )
ping -n 20 localhost >nul
goto :loop

这篇关于无尽的时间,能循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆