Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to run an C# application as an schedule Task

Posted on 2015-02-03
4
Medium Priority
?
123 Views
Last Modified: 2015-02-18
I have an C# application that is ran daily at 8:00am, where the user has to click the Run Gain Loss button on the form. I've attached a screenshot of the form. I'm looking for a solution where the application would run and the Run Gain Loss button is click automatically daily at 8:00am. I know I can setup a scheduled task to run the C# application at 8:00am but how do I execute the Run Gain Loss button? Any ideals on how I can get this application to run automatically, maybe some 3rd party software to click the Run Gain Loss button. Again, any ideals would much appeciated.

Thanks in Advance
0
Comment
Question by:gilweber3
4 Comments
 
LVL 17

Accepted Solution

by:
OriNetworks earned 1500 total points
ID: 40586764
If you don't have the ability to call an API within the software then there are automation frameworks such as AutoIt https://www.autoitscript.com/site/autoit/
0
 
LVL 37

Expert Comment

by:Kimputer
ID: 40586786
Usually I use AutoHotkey for these things. Please note the caveat, the screen has to be on and logged in. Therefore, it's better to get it running without the button (will take the original developer 4 seconds of work), that way the job always runs (even when you're not logged on)
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 40586979
I wouldn't rely on something to click a button. What if you redesign and the button moves? It will stop working.

Instead, have the code behind the button callable from elsewhere then the button and pass a parameter to your application to run your new method.

Check http://emoreau.com/Entries/Articles/2008/11/Passing-arguments-to-an-application-startup.aspx
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 40587010
Do you have the source code for this application?  That's not clear from the description.  If yes, then I'd go with Eric's suggestion and pass a parameter to the app so you 'll know to run the code associated with the button click.

Depending on what the app does, it might be possible to re-design it so all the work gets done from within program.cs without ever showing a form.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Integration Management Part 2
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question