I was wondering if someone could help me, I am trying to list Scheduled Tasks from a specific user (Admin) on the local computer using the TaskScheduler Class (http://www.codeproject.com/KB/cs/tsnewlib.aspx) I have the following:
// richTextBox6.Text = string.Join(Environment.NewLine, taskNames);
private void button22_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
string machineName = (@"\\" + System.Environment.MachineName);
ScheduledTasks st = new ScheduledTasks(machineName);
// Get an array of all the task names
string[] taskNames = st.GetTaskNames();
foreach (var taskName in taskNames)
{
listBox1.Items.Add(taskName);
}
st.Dispose();
}
"@"\"" Specifies that the local machine is the target, but is it possible to add a user to this? (Since it only lists tasks that are in C:\Windows\Tasks when executed)