I was wondering if anyone can help me, I am trying to list the scheduled tasks for a specific user (administrator) on the local computer using the TaskScheduler class (http://www.codeproject.com/KB/cs/tsnewlib.aspx) I have the following:
private void button22_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
string machineName = (@"\\" + System.Environment.MachineName);
ScheduledTasks st = new ScheduledTasks(machineName);
string[] taskNames = st.GetTaskNames();
foreach (var taskName in taskNames)
{
listBox1.Items.Add(taskName);
}
st.Dispose();
}
"@" \ "" Indicates that the local machine is the target, but can a user be added to it? (Since it only displays tasks that are in C: \ Windows \ Tasks when executed)
source
share