Windows 10 task scheduler errors "task not supported" - windows

After updating to W10 I think task scheduler worked normally. Today I tried to open %windir%\system32\taskschd.msc /s and got a long list of errors that said "this version of task object is not supported or invalid" all being tasks made in W7 I guess. After escaping the messages all kinds of tasks "are not there" anymore, although when opening taskschd again the same thing happens. I am working on it and I succeeded in importing one of those tasks and comparing the xml. Hope someone has already found a good solution. Will update my findings.

You can solve this using cmd:
C:\>schtasks /Query > tasks.txt
This command prints all configured tasks into a txt on your C: drive (or your current working directory). I used cmd as administrator I think that's neccessary. Afterwards you can delete all tasks which are wrong:
C:\>schtasks /Delete /TN "\ASUS\ASUS AI Suite II Execute" /F
ERFOLGREICH: Die geplante Aufgabe "\ASUS\ASUS AI Suite II Execute" wurde erfolgreich gelöscht.
I hope that works for you too.
Regards
Steffen

Related

cmd.exe returns "Not enough storage is available to process this command."

...have been running Widows 7 Pro with STARTUP folder modified to run two BATs to create two CMD boxes, one left and one right. A few days ago at logoff time 13 updates to Windows7 were installed and at logon the next day the two CMD boxes had a new error message preceding the command prompt:
"Not enough storage is available to process this command."
Typing in "DIR /X" at the command prompt does return the directory list but with three error messages:
1. The system cannot find message text for message number 0x235f in the message file for Application.
2. The system cannot find message text for message number 0x235b in the message file for Application.
3. DNS bad key
...i.e. none of the usual DIR text annotations.
Now, from the command line, any BAT file with "cmd /k" in it produces the same box with the same errors.
Modifying a BAT file to call "C:Windows\System32\cmd.exe /k" instead of simply "cmd /k" solves the BAT problem on the command line...AND making this change in the two STARTUP BATs solves the problem at startup. However, this is just a temporary work-around. The bare "cmd" without the full path will fail.
CORRECTION: as suggested by Harry Johnston below, there was another cmd.exe present, this one in C: identical to the one in C:\Windows\System32 and after giving it an alias the STARTUP BATs work OK. So this post becomes a trivial anomaly which may or may not have resulted from a Windows update, and may be deleted.
Does anyone know what updates to Win7 caused this problem, and how they might be uninstalled. Good ol' WinXP would have a long list of them.
There's a lot of interesting and relevant info here:
https://superuser.com/questions/159034/spurious-out-of-memory
and here:
http://blog.airesoft.co.uk/2009/10/desktop-heap-monitor-vista-7/
but maybe someone has a quick answer.
..Thanks for any reply.
Encountered same problem, And there was a spurious copy of "cmd" sitting around. Tx

Task Scheduler failing to Kill Outlook

I have a scheduled task to kill outlook and this task runs with SYSTEM account (Run whenever user is logged or not / Run with highest privileges are marked)
The action is:
- Start a program
- Program/Script: "taskkill/im outlook.exe"
This doesn't work neither with "C:\Windows\System32\cmd.exe taskkill/im outlook.exe"
I get the error:
Task Scheduler failed to start instance "{a394e482-f326-47ad-995e-664f484926e9}" of
"\Close Outlook" task for user "DOMAIN\CA18-0JG5S49$".
Additional Data: Error Value: 2147942403
Any ideas on what to do?
I DO NOT want to use VBS to kill Outlook. It must be done directly with a command.
Thanks.
You need to put a space between taskkill and its arguments. Change
taskkill/im outlook.exe
into
taskkill /im outlook.exe
Basically, taskkill should be in the "Program" field of the task, and /im outlook.exe in the "Arguments" field.
I know this is an old thread, but throwing in something no-one else seems to have mentioned.
Using taskkill /T /im outlook.exe doesn't work the FIRST time, but if you run this command with say 2 emails opened and the reminders box, it will close the reminders box. Run it again, and closes outlook. Sometimes, you have to run it a third time, as it only closes emails on the second attempt, but 3 times is a charm, usually.
Not very consistent, but at a push, you could put the command into the batch file 3 times to give clunky but workable outlook shutdown routine. I've seen similar behaviour with other commands. For instance, rmdir /S doesn't always delete the full directory structure on the first attempt, so when using it in a batch file I would always put it in twice to be sure, to be sure.

running an R script in batch mode without the command prompt popping up

I have a scheduled task (using SCHTASKS) to run every minute.
SCHTASKS /Create /SC MINUTE /MO 1 /TN READSCALE /TR "Rcmd BATCH --vanilla --slave q:\workspace\waga\readScale.R"
On each run command prompt window pops up. It's slightly irritating and perhaps a potential health hazard for people with epilepsy. In Java, one can use javaw.exe (see this thread) that doesn't pop up a command prompt. Is there an equivalent for R?
Kudos to serverfault.com, where some people solved the problem using no external tools at least in two ways. Here's the thread.
First is to write a .vbs script. This requires some knowledge of this scripting language and may not be appropriate for everyone.
The second method is to run the task (as I'm doing) under SYSTEM (and not the currently logged in user).
Ah, Windows... There is a tool called hstart which may help here.

Windows scheduled task

I have created a Windows 7 scheduled task:
schtasks /create /tn MyTask /tr C:\temp\test\MyScript.bat /sc MINUTE
Problem is that this task seems to get executed by Windows but I think it can not find the running BAT script. There is a quick flash window but can't read what the problem is.
On the other hand, if I place the script under Windows/System32 everything works fine.
schtasks /create /tn MyTask /tr C:\windows\system32\MyScript.bat /sc MINUTE
Anyone knows why the second schedule task works compared to the first one?
This whole thing is part of installing a program on a windows machine from a web page. So I would like to have the BAT file installed in its correct directory and not the System32.
Thanks for you help.
C:\temp is a temporary directory may be cleaned by the OS periodically. So you should first check to make sure that batch file is actually there, and then consider moving it to a more permanent location.
Second, have you tried running the task manually from its intended location? That should help you see what the output is. You can also add PAUSE to the bottom of the batch file (as suggested by commenters) to ensure that it stays up long enough for you to see the output.
Some likely problems are:
You're using some resource which is in %windir% via a relative path, which won't work when the batch file is run from a different location.
The scheduled task is running as a different user and doesn't have the proper permissions.
The task is doing something that requires elevation, but the task itself is not set to run elevated.
IIRC, schtasks does not load user profile: Most probably a variable is not set that you need.
Try to prepend your command line (after /tr) with cmd /K. It will make the console kept alive.
HTH

Schtasks.exe does not accept blank spaces when giving file path

I'm rolling out a new python script at the office and to make this run smooth I also made a batch file which will install it, and make it run on user logon.
I use schtasks.exe to schedule a task for this, so here is what i'm trying to run
schtasks /create /TN "fooname" /SC ONLOGON /TR "C:\foo - bar\fooscript.exe" /Delay 0005:00
The error I get is 0x80070002 which means the file cannot be found. After exporting the task I created, I can see that it separated the first and last bit of the path into
<Command>C:\foo</Command>
<Arguments>bar\fooscript.exe</Arguments>
I have tried microsofts own help article, but no luck. I wish to run this without any arguments regarding fooscript.exe.
As Magoo pointed out I was able to use the short name of the folder, which can be accessed with a
dir /x
tossing back a name like "FOO~1". Using this in my path made it work.
Thank you!
Sorry old thread but just found a workaround better than these here. Put the dir name in a prompt variable and then use the var in the command.
SET fname="c:\path with spaces\target.exe"
SchTasks [args] /TR %fname%

Resources