What is the Windows version of cron?

2018-12-31 02:34发布

A Google search turned up software that performs the same functions as cron, but nothing built into Windows.

I'm running Windows XP Professional, but advice for any version of Windows would be potentially helpful to someone.

Is there also a way to invoke this feature (which based on answers is called the Task Scheduler) programatically or via the command line?

15条回答
步步皆殇っ
2楼-- · 2018-12-31 03:07

The closest equivalent are the Windows Scheduled Tasks (Control Panel -> Scheduled Tasks), though they are a far, far cry from cron.

The biggest difference (to me) is that they require a user to be logged into the Windows box, and a user account (with password and all), which makes things a nightmare if your local security policy requires password changes periodically. I also think it is less flexible than cron as far as setting intervals for items to run.

查看更多
忆尘夕之涩
3楼-- · 2018-12-31 03:08

For the original question, asking about Windows XP (and Windows 7): Windows Task Scheduler

For command-line usage, you can schedule with the AT command.

For newer Microsoft OS versions, Windows Server 2012 / Windows 8, look at the schtasks command line utility.
If using PowerShell, the Scheduled Tasks Cmdlets in Windows PowerShell are made for scripting.

查看更多
骚的不知所云
4楼-- · 2018-12-31 03:08

The 'at' command.

"The AT command schedules commands and programs to run on a computer at a specified time and date. The Schedule service must be running to use the AT command."

查看更多
临风纵饮
5楼-- · 2018-12-31 03:08

Zcron is available free for personal use.

查看更多
泪湿衣
6楼-- · 2018-12-31 03:11

pycron is close match on Windows.

The following entries are supported:

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
查看更多
忆尘夕之涩
7楼-- · 2018-12-31 03:11

If you prefer good ol' cron, CRONw is the way to go.

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
查看更多
登录 后发表回答