在 Windows XP 中使用 schtasks.exe 重复任务?
我需要在 Windows XP 上从每个工作日的上午 9 点到下午 3 点每 10 分钟运行一次任务。我已使用以下命令来执行此操作,但在 Windows XP SP3 上我认为 /RI 选项不可用。
schtasks /Create /RU HS77 /RP /SC DAILY /TN 任务名称 /TR C:\Windows\System32\calc.exe /ST 15:10 /RI 10 /ET 15:31 /K /SD 09/07/ 2009 /ED 09/07/2009 /F
有没有办法用命令行(仅命令行)来完成它。请帮助我。提前致谢。
**我的要求:**每周早上 9:00 到下午 3:00 每 10 分钟运行一个 exe。使用程序或从bat 文件或命令行仅安排一次。
**编辑:**好吧看来我需要想办法。我的主要问题是 /ET 选项(结束时间)在 XP 中被禁用。因此,我正在通过一个批处理文件进行尝试,该文件将从上午 9:00 开始创建明天早上的计划任务,而 ac 程序将在下午 3:00 时将其删除,并在第二天早上 9:00 重新创建计划任务。并且这个过程会重复。但这里系统日期格式也破坏了情节。我需要想办法。
我错过了一个简单的方法吗?(生气..哈)。
或者,将 Windows 调度程序扔进垃圾箱,并使用任何开源的小型调度程序,它可以为我完成所需的工作,并且我们可以将其与我们的应用程序打包在一起?或者我是否需要编写自己的自定义调度程序,它可以在背景? (这是一个全新的问题)。如果我需要编写一个命令行自定义调度程序,如何在 XP 的后台运行它。或者如何在后台运行计划任务(我的意思是 cmd.exe 在运行时不应弹出)。
抱歉问题太多。我有点沮丧。请理解。
I need to run a task every 10 mins from morning 9 AM to Evening 3 PM every weekday on my Windows XP. I have used the following command to do that but on Windows XP SP3 I think /RI option is unavailable.
schtasks /Create /RU HS77 /RP /SC DAILY /TN taskname /TR C:\Windows\System32\calc.exe /ST 15:10 /RI 10 /ET 15:31 /K /SD 09/07/2009 /ED 09/07/2009 /F
Is there any way of doing it with command line (only command line).Please help me..Thanks in advance.
**My Requirement:**Run an exe every week day morning 9:00 am to 3:00 pm every 10 mins. Schedule it using a program or from bat file or command line only once.
**EDIT:**Ok Looks like I need to figure out a way. My main problem is the /ET option (End Time) is disabled in XP. So I am trying it through a batch file which will create scheduled task for tomorrow morning starting at 9:00 AM and a c program which will delete it when it is 3:00 PM and recreate the scheduled task at next day morning 9:00 am. And this process repeats. But here also System date format is spoiling the plot. I need to figure out a way.
Am I missing an easy way?(angry..haa).
Or else throw out the windows scheduler in dust bin and use any open source small foot print schedulers which can do the required work for me and we can package it with our application?Or do I need to write my own custom scheduler which can run in background? (this is a whole new question). If I need to write a command line custom scheduler how can I run it in background in XP. Or How can I run a scheduled task in background(I mean cmd.exe should not popup when it is running).
Sorry for too many questions. I am a bit frustrated. Please Understand.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您刚刚错过了 /MO 选项。不管怎样,我希望你现在已经解决了你的问题。可能是我来晚了。但还是……
所以让它变得非常简单,看起来像这样
schtasks /create /sc 分钟 /mo 10 /tn calc /tr c:\windows\system32\calc.exe
我相信您可以添加其他内容来满足您的需求。
问候,
阿姆罗兹。
You just missed the /MO option. Anyway, I hope you might have solved your problem by now. May be I am late. But still....
So making it very simple, it looks like this
schtasks /create /sc minute /mo 10 /tn calc /tr c:\windows\system32\calc.exe
I am sure you can put in the other stuff to suit your needs.
Regards,
Amroz.
我认为 Windows XP 中的 schtasks 不可能做到这一点。您可以将其配置为每十分钟运行一次 VBScript,并且在该 VBScript 中您可以检查工作日和时间。
I don't think that is possible with schtasks in Windows XP. You could config it to run a VBScript every ten minutes and in that VBScript you can check weekday and time.