通过谷歌搜索可以找到与cron功能相同的软件,但没有内置在Windows中。

我使用的是Windows XP Professional,但任何版本的Windows建议都可能对某些人有所帮助。

是否也有一种方法以编程方式或通过命令行调用此功能(基于答案称为任务调度器)?


当前回答

At命令现在已弃用

你可以使用SCHTASKS

其他回答

如果你更喜欢好的cron, CRONw是你的选择。

Supported systems

* Windows 2000 (any version)    works
* Windows XP (SP 2)             works
* Windows Server 2003           works
* Windows NT 4 (SP 6)           should work but not tested
* Windows 3.11, Windows 95,
  Windows 98, Windows ME,
  Windows XP beneath SP2        not supported by design

At命令现在已弃用

你可以使用SCHTASKS

使用Windows任务计划程序按时间和日期安排任务。

pycron与Windows非常匹配。支持以下表项:

1    Minute (0-59)
2    Hour (2-24)
3    Day of month (1-31)
4    Month (1-12, Jan, Feb, etc)
5    Day of week (0-6) 0 = Sunday, 1 = Monday etc or Sun, Mon, etc)
6    User that the command will run as
7    Command to execute

对于最初的问题,询问Windows XP(和Windows 7): Windows任务调度器

对于命令行使用,您可以使用AT命令进行调度。

对于较新的微软操作系统版本(Windows Server 2012 / Windows 8),请查看schtasks命令行实用程序。 如果使用PowerShell, Windows PowerShell中的计划任务cmdlet是为脚本编写的。