2 Replies - 346 Views - Last Post: 27 September 2012 - 07:25 AM Rate Topic: -----

#1 matleeds  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 25-August 11

How to automate the running of an application

Posted 27 September 2012 - 02:37 AM

Hi,

I wish to start and run an application automatically.

I can create a task in Task Scheduler (It's still called this in Vista, don't know about windows nt, 7 or 8) to start the application daily at a specific time. No problem.

However, I actually want the app to perform some functions.

I'm thinking that passing some command line parameter through to the app when it starts through the task I've set up but a) I'm not sure how to do that in Task Sceduler and B) I'm not sure what code I need to include in the application to pick up on the command line parameter.

I'm using c# 3.5 and viz stud 2008 and i guess it's a winform application at the mo too.

thanks

Is This A Good Question/Topic? 0
  • +

Replies To: How to automate the running of an application

#2 dotINSolution  Icon User is offline

  • New D.I.C Head

Reputation: 6
  • View blog
  • Posts: 16
  • Joined: 25-September 12

Re: How to automate the running of an application

Posted 27 September 2012 - 03:14 AM

To get your application to pick up on the command line paramaters, use the method Environment.GetCommandLineArgs
Was This Post Helpful? 1
  • +
  • -

#3 Curtis Rutland  Icon User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4559
  • View blog
  • Posts: 7,972
  • Joined: 08-June 10

Re: How to automate the running of an application

Posted 27 September 2012 - 07:25 AM

It's also easy to add command line arguments to the Task in the scheduler:

Attached Image

See where it says "Add arguments"?
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1