Windows 8.1 task scheduler won't run script

Started by srothkin, November 18, 2013, 01:27:45 PM

Previous topic - Next topic

srothkin

I am getting Task Scheduler failed to launch action "C:\Program Files (x86)\WinBatch\system\WinBatch.exe" in instance "{8752646d-46f3-4316-824f-9a2ba9b0a1d4}" of task "\MozBackup". Additional Data: Error Value: 2147943140.

This is with WinBatch 2013C on a new Windows 8.1 laptop to take the place of my wife's old Windows 7 laptop.
The script currently runs fine via the scheduler in her old Windows 7 laptop with WinBatch 2010A.

The task is already set for run only when user is logged on, run as her, run with highest privileges, and configure for Windows 8.1. In fact, the ONLY difference in the task scheduler settings compared to the old machine (where it is currently working fine) is configured for Windows 8.1 instead of Windows 7 (though I tried that too and it didn't make a difference).

I've googled the error and haven't found anything that gives me a working fix so far.

I've included the script below for reference:

Terminate(Display(30, "Firefox and Thunderbird AutoBackup", "Will shut down Firefox and Thunderbird in 30 seconds to do automatic backup.%@crlf%Click this window before then to cancel."),"Firefox and Thunderbird AutoBackup","Autobackup canceled")


If AppExist("firefox.exe")==@TRUE
   TerminateApp("firefox.exe",3,0)
   AppWaitClose("firefox.exe")
Endif


If AppExist("thunderbird.exe")==@TRUE
   TerminateApp("thunderbird.exe",3,0)
   AppWaitClose("thunderbird.exe")
Endif


RunShell("C:\Program Files (x86)\MozBackup\mozbackup.exe", "Firefox.mozprofile", "C:\Program Files (x86)\MozBackup", @NORMAL, @WAIT)
RunShell("C:\Program Files (x86)\MozBackup\mozbackup.exe", "Thunderbird.mozprofile", "C:\Program Files (x86)\MozBackup", @NORMAL, @WAIT)

td

The error 2147943140 has the text, "The requested operation requires elevation".  So is the user account being used to run the task in  task scheduler an administrator account?   Does the the program mozbackup.exe require administrator privileges?  And was UAC enabled on your Windows 7 system?
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

Deana

If not manifested correctly UAC may attempt to prompt the user to elevate. this problematic from windows tasks, they do not like to be interactive. The WinBatch.exe is manifested as HighestAvailable/True. We provide differently manifested version of the interpreter. I recommend using the AsInvoker/False manifested interpreter instead. This should prevent the script from attempting to elevate.

C:\Program Files (x86)\WinBatch\System\WinBatch_IF.EXE

So open the task in task scheduler and change the path tot he winbatch.exe. From:

C:\Program Files (x86)\WinBatch\System\WinBatch.EXE

to

C:\Program Files (x86)\WinBatch\System\WinBatch_IF.EXE

Let us know if that resolves the issue.
Deana F.
Technical Support
Wilson WindowWare Inc.

srothkin

Thank you. Yes, that fixes it.

A bit surprised since I configured the task to be highest privileges, but whatever works ;)

Deana

Quote from: srothkin on November 18, 2013, 02:13:53 PM
Thank you. Yes, that fixes it.

A bit surprised since I configured the task to be highest privileges, but whatever works ;)

Keep in mind, using the highest available manifest can cause a UAC prompt to appear. See the "UAC" section in the help file for an explanation.
Deana F.
Technical Support
Wilson WindowWare Inc.

td

Quote from: srothkin on November 18, 2013, 02:13:53 PM
A bit surprised since I configured the task to be highest privileges, but whatever works ;)

On Windows 8 configuring a task to run with highest privileges does not override UAC prompting and the task scheduler will not switch to the secure desktop so that the elevation prompt can be displayed.   

On Vista and Windows 7 the Task Scheduler would launch the task without a prompt when the Run with highest privilege was checked.  In fact, this was a nifty way to circumvent UAC on a per application basis using a desktop shortcut. IIRC,  there is a tech db article that mentions using a scheduled task for this purpose.  It should be amended to reflect the fact that the technique no longer works on Windows 8.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

The Windows 8 task scheduler elevation issue is even more pernicious that first thought because it will not run a program requiring elevation even with UAC prompting turned off.  So displaying the UI prompt or any UI is not an issue at all.  That leaves just one of the system account or maybe the built in administrator account (haven't tried that one yet) to run scripts or programs that requires full admin. privileges in the task scheduler.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade