Solved

Scheduling an exe (emoreau's example)

Posted on 2013-01-07
5
205 Views
Last Modified: 2013-01-08
I've followed this code

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

Method 2 of that link. I compiled and have an exe. I want to schedule it as a Service. Per that article, I need to pass a paramter '/batch' to have it run as a service...

When I'm in debug, I add the command line argument to "Debug" tab of properties. When I want to schedule the exe...where do I need to put the command line argument?

Thanks
0
Comment
Question by:Camillia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 17

Assisted Solution

by:Kent Dyer
Kent Dyer earned 250 total points
ID: 38752551
Depends on where you are running the scheduled task..

Windows XP or 2000/2003 would take the switch on the same command line..

I think Windows 2008 has a place for parameters..
Same with Task Scheduler Professional..

Have a look at SCHTASKS.exe to set this up...
http://ss64.com/nt/schtasks.html

HTH,

Kent
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 38753196
are you creating your task manually in the Windows "Task Scheduler"? If so, you can add your argument to name of the exe.

or you can create a batch file with that argument and launch the batch in the task
0
 
LVL 7

Author Comment

by:Camillia
ID: 38753202
I think I will use Windows Task Scheduler. I've never done this before tho. What do you mean adding it to the name of the exe?  I know if I right click on the exe, select "properties", there's a "Target" field and I can add the paramter to end of it. Is this what you mean?
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 250 total points
ID: 38753210
the task scheduler screens varies according to the version of windows you are using

whatever the version your are using, there is a place where you set the full path of your exe. you can add /batch at the end
0
 
LVL 7

Author Comment

by:Camillia
ID: 38753225
i will look. I will keep this question open for now. Thanks for your help.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Code works but breaks when I add one section 4 31
Set custom font WPF 2 22
parse string in c# 5 31
C# Get Current Exchange Rate from XE 9 18
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 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