1
General Software Discussion / Re: WinSendKeys (Automate Task Scheduler)
« on: November 11, 2012, 05:06 PM »
The Strokesfile is very basic:
--winwait schtasks.exe 6
{ENTER}
I tried:
--winwait schtasks.exe
{ENTER}
but the result(ing logfile) is the same.
The 'Window '' not found' error is thrown immediately, whether waiting for 6 seconds or not. Wouldn't the logfile show a time-out error if that were the problem?
This is what happens:
I have noticed that if I repeatedly start WinSendKeys (with my line), it will error from the first try and keep on erroring until it works. Then it will work until it errors. It will usually error only once and then work again a number of times in a row, etc.
--winwait schtasks.exe 6
{ENTER}
I tried:
--winwait schtasks.exe
{ENTER}
but the result(ing logfile) is the same.
The 'Window '' not found' error is thrown immediately, whether waiting for 6 seconds or not. Wouldn't the logfile show a time-out error if that were the problem?
This is what happens:
- I open an elevated command prompt and enter: WinSendKeys -x schtasks -xp "/create /xml ""X:\task.xml"" /ru ""COMP. NAME\USER NAME"" /tn ""Imported Task""" -f "X:\Wait.sro" schtasks.exe
- When I hit [Enter], almost immediately (-1 second) a new command prompt window opens, which states "Please enter the run as password for COMPUTER NAME\USER NAME:"
- - When things work as intended, WinSendKeys sends am [Enter] and the window closes.
- - When they don't, almost at the same moment the new command prompt opens (so fast, it's hard to tell which is first) a window pops-up with the 'Window '' not found' error.
I have noticed that if I repeatedly start WinSendKeys (with my line), it will error from the first try and keep on erroring until it works. Then it will work until it errors. It will usually error only once and then work again a number of times in a row, etc.