?
Solved

Pass Argument into C# TaskScheduler dll without re-registering the Task

Posted on 2013-01-04
1
Medium Priority
?
921 Views
Last Modified: 2014-11-07
I have this project that I need to basically retrieve a task (Bat) on a remote machine and Run it with some parameters passed into the Arguments of the ExecActions property.

So far I have
TaskSchedulerClass scheduler = new TaskSchedulerClass();
scheduler.Connect(MachineName, null, null, null);
ITaskFolder folder = scheduler.GetFolder("\\");
IRegisteredTask regTask = folder.GetTask(ScheduledTaskName);
regTask.Run(ScheduledTaskParameter);

Open in new window


Upon reading on MSDN I know that you can pass in ExecAction.Arguments as $(Arg0) into the .Run(). what is the correct syntax to pass in the parameter?
0
Comment
Question by:symphony-it
[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
1 Comment
 
LVL 15

Accepted Solution

by:
Minh Võ Công earned 200 total points
ID: 38777257
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A safe way to clean winsxs folder from your windows server 2008 R2 editions
For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Suggested Courses

752 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