Windows7-使用c#.net在Windows应用程序中创建调度程序任务
亲爱的所有人,
我想在调度程序任务中运行一个exe("Ex:mymodule.exe"),如何使用c#.net中的代码创建用于执行我的exe的调度程序任务.我可以选择每日",一次",每月".
当尝试使用以下代码时出现错误:访问被拒绝
sCreateArg = @"/create/S" + @sIPAddress +"/tn" + sSchedulerName +"/tr"
+ ExePath +"/sc Daily/st" + sStartTaskTime +"/ru" + sUserName;
我已经检查了本地系统用户名和密码,以及远程系统用户名,密码
预先谢谢您
Dear All,
I want to run one exe("Ex:mymodule.exe") in scheduler task, how to create scheduler task for execute my exe with codeing in c#.net. where i can have option of Daily, Once, Monthly.
When am trying with below code am getting Error: Access Denied
sCreateArg = @"/create /S " + @sIPAddress + " /tn " + sSchedulerName + " /tr "
+ ExePath + " /sc Daily /st " + sStartTaskTime + " /ru " + sUserName;
I have checked with Both Local system username and Password and Remote system username,Password
Thank you In advance
我认为最好的方法是创建自己的Scheduler.
Windows服务将帮助您实施项目.
请按照以下代码获取有关Windows Service的更多信息:
Windows服务应用程序简介 [如何从Windows服务运行进程 [ ^ ]
I think the best way is creating your own Scheduler.
The windows service is going to help you to implement your project.
Follow the below code for more info about Windows Service:
Introduction to Windows Service Applications [^]
How to run a process from the Windows service [^]
sCreateArg = @"/create/S" + @sIPAddress +"/tn" + sSchedulerName +"/tr" + sPath +"/sc" + sScheduleTask.ToLower()+ "/st" + sStartTaskTime +"/ru" + sUserName +"/rp" + sPassword;
sCreateArg = @"/create /S " + @sIPAddress + " /tn " + sSchedulerName + " /tr " + sPath + " /sc " + sScheduleTask.ToLower() + " /st " + sStartTaskTime + " /ru " + sUserName + " /rp " + sPassword;