topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday April 29, 2024, 9:15 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Day Agent [ switch to compact view ]

Pages: [1]
1
General Software Discussion / WinSendKeys (Automate Task Scheduler)
« on: November 09, 2012, 08:38 PM »
I have been trying to automate importing a task into Task Scheduler, to be run from a user account which has no password.
This requires [Enter] be pressed to confirm there is no password, before schtasks accepts the task.

A user account with a password would resolve the problem, but this is not an option.
NT AUTHORITY\SYSTEM would be accepted as a user without a password, but this is not an option either.

The syntax for importing the task (in my case) is this:

schtasks /create /xml "X:\task.xml" /ru "COMPUTER NAME\USER NAME" /tn "Imported Task"

To deal with the multiple quotes, the parameters are assigned to a variable PRMTRS.

Although schtasks %PRMTRS% works as expected, when I try to use WinSendKeys to launch schtasks with the parameters, wait a few seconds and then send [Enter], it doesn't work. This is (among several other variations) is the line I have tried:

WinSendKeys -x schtasks -xp %PRMTRS% -xd 5000 {ENTER}

I'd appreciate some advice.

"X:\task.xml", "COMPUTER NAME\USER NAME" and "Imported Task" are generic placeholders.
In reality, "COMPUTER NAME\USER NAME" might be "John's Computer\John Smith".

Pages: [1]