在Windows Time Scheduler上运行VB Exe [英] Run VB Exe on Windows Time Scheduler

查看:85
本文介绍了在Windows Time Scheduler上运行VB Exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Windows Scheduler上运行由vb创建的应用程序?

我需要添加什么?

我在一个带有组合框和2个按钮的单一窗体中运行程序.

How can i run my vb created application on windows scheduler?

What will i need to add?

I run my program in a single Form, with a combo box and 2 buttons.

推荐答案

您无需更改任何内容-调度程序服务已经存在.相反,您可以使用命令行实用程序AT.EXE或CSHTASKS.EXE(将替换AT.EXE)来安排事件,请参见:
http://en.wikipedia.org/wiki/At_%28Windows%29 [ ^ ],
http://en.wikipedia.org/wiki/Schtasks [ http://technet.microsoft.com/en-us/library/bb490866.aspx [ ^ ],
http://msdn.microsoft.com/zh-我们/library/windows/desktop/bb736357%28v=vs.85%29.aspx [ http://msdn.microsoft.com/zh-我们/library/windows/desktop/aa383614%28v=vs.85%29.aspx [ http://msdn.microsoft.com/zh-我们/library/windows/desktop/aa383608%28v=vs.85%29.aspx [ .NET的新任务计划程序类库 [ ^ ].

—SA
You don''t have to change anything — the scheduler service already exists. Instead, you can schedule events using command-line utilities AT.EXE or CSHTASKS.EXE (which is replacing AT.EXE), see:
http://en.wikipedia.org/wiki/At_%28Windows%29[^],
http://en.wikipedia.org/wiki/Schtasks[^],
http://technet.microsoft.com/en-us/library/bb490866.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/bb736357%28v=vs.85%29.aspx[^].

From the other hand, you also can use Window Task Scheduler API, please see:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383614%28v=vs.85%29.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383608%28v=vs.85%29.aspx[^].

To see how can you use it with .NET, see this CodeProject article: A New Task Scheduler Class Library for .NET[^].

—SA


您可以使用命令参数来启动计划的程序.
在您的表单中,检查子New()
中的命令参数 公共类Yourform
私有_IsSchedule为布尔值
公共子new()

如果Environment.GetCommandLineArgs()(1)="SCHEDULE",则
''开始计划程序
其他
''用户
如果结束

结束Sub


用户可以不带参数启动程序.

在计划任务中,启动YourProgram.Exe SCHEDULE
You can use command arguments to start scheduled program.
In your form you check the command argument in the sub New()
public Class Yourform
Private _IsSchedule as boolean
public sub new()

If Environment.GetCommandLineArgs()(1) = "SCHEDULE" then
''start schedule procedure
else
''user
End If

end Sub


User can start your program without parameter .

In schedule task you start YourProgram.Exe SCHEDULE


这篇关于在Windows Time Scheduler上运行VB Exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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