如何让exe同时运行? [英] What do I do to make a exe to run simultaneously at the same time?

查看:102
本文介绍了如何让exe同时运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I have a console application (exe assembly) which i need to set up as a scheduled task.

based on passed arguements in main method, It performs two different functions. 

I have set up two job name pointing to the same exe and each has got its own arguements.

what do i do to make it run simultaneously at the same time?





我是什么尝试过:





What I have tried:

static void Main(string[] args)
{
 if (args.Length > 0)
                {
                    if (args[0].Trim().ToLower() =="excel")
                    {
                       CreateExcelFile();
                    }
                }
                else
                {
				CreatePdfFile();
				}
}

推荐答案

您的问题描述根本不清楚。



在任务计划程序中,您可以根据需要安排任意数量的任务,并且可以同时执行这些任务。您只需在任务中设置时间即可。没有什么可以说你一次只能运行一个任务。



在你的情况下,你设置了两个计划任务,每个任务具有相同的可执行文件,但参数不同取决于你想要该实例做什么。
Your problem description isn't clear at all.

In Task Scheduler, you can schedule as many tasks as you want and they can be executed at the same time. You just set the time in the task when you want it to execute. There's nothing that says you can only have one task running at a time.

In your case, you setup two scheduled tasks, each with the same executable, but different parameters depending on what you want that instance to do.


我在触发exe时发现了错误的原因。两个作业都试图使用相同的日志文件来写日志。我为每个作业分隔了日志文件。现在它不会抛出任何错误。



谢谢大家伸出援手帮助我。
I found out the cause for the error while triggering the exe at the same. Both job trying to use the same log file to write the log. I separated the log Files for each job. Now it does not throw any error.

Thank you guys for reaching out and helping me.


这篇关于如何让exe同时运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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