Bulk Change Password on Scheduled Tasks

Hi Experts,

how can i reset the password on numerous Scheduled tasks?

Optionally Filter by "Start In" field
i.e. Only do the tasks with the Start In as "C:\Program Files\JetReports\" or Do all.

I'm fluent in VBA and VB .NET

Even if its only a starter, i'm sure i can continue on.

It will be on a remote computer inside the domain.
Computer Name PURCH006
I can use \\PURCH006\C$\WINDOWS\Tasks to view them
All Computers are Windows XP
LVL 10
bromy2004Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

2CsCommented:
bromy2004Author Commented:
Hi Al,

Unfortunately i can't use any variation of AT or SCHTASKS because the "Run" command is longer than 255 Characters (About 300-500 characters)

I did however find a really good dll that works like a dream and created a very simple Task Scheduler Password Reseter (Thats why i'm not in marketing, hopeless naming conventions) in VB .NET

First Image is the Form i created
The code is for Form1

Added a reference to TaskScheduler available here for free http://www.codeproject.com/KB/cs/tsnewlib.aspx

As far as I know it doesn't work in Windows 7, but i haven't tested it.
Imports t = TaskScheduler

Public Class Form1

  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim tskSch As t.ScheduledTasks
    Dim tskTaskName As String()
    Dim tskTask As t.Task
    If Not Mid(Me.TextBox1.Text, 1, 2) = "\\" Then
      Me.TextBox1.Text = "\\" & Me.TextBox1.Text
    End If

    tskSch = New t.ScheduledTasks(Me.TextBox1.Text)
    tskTaskName = tskSch.GetTaskNames()

    For Each tskName As String In tskTaskName
      tskTask = tskSch.OpenTask(tskName)
      With tskTask
        .SetAccountInformation(Me.TextBox2.Text, Me.TextBox3.Text)
        Debug.WriteLine("Task {0}", tskTask)
        .Save()
        .Close()
      End With
    Next tskName

  End Sub
End Class

Open in new window

ScreenShot002.jpg

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.