Windows Scheduled Task – Causes of Error 2147942402

scheduled-taskwindowswindows-server-2008

Windows Server 2008 R2 (fully patched)

I'm trying to run a scheduled task to move a specific type of files from C:\Windows\Temp to E:\Foo_blah_blah_blah_blah\Foo2 and for some reason am getting the following error:

Task Scheduler failed to start instance "{fe0f148a-cece-44a0-a4d1-914aaf21daa8}" of "\Move Temp Files" task for user "FOOBOX\Administrator". Additional Data: Error Value: 2147942402

Any idea why this is happening?

Additional details:

  • The task is configured to run as an account that has authority to move the file.
  • The task is configured to run whether user is logged on or not. It fails for both scenarios – same errors.
  • The task is configured to run for the local OS (Windows Server 2008)
  • The command is broken up into two parts. Program/script: move Add Arguments: C:\Windows\Temp\*.foo E:\Foo_blah_blah_blah_blah\Foo2\

If I run this same command move C:\Windows\Temp\*.foo E:\Foo_blah_blah_blah_blah\Foo2\ from the windows command prompt, it works fine.

What am I missing?

Best Answer

As Ryan Ries pointed out, 2147942402 translates to "File not Found" - which is a very appropriate response. Try and press Win+R, put in "move" and press enter - that's the interactive equivalent of what your task is failing to do.

The reason is that MOVE is not a program, but a native command in cmd.

It should be:

Program: "cmd.exe"
Arguments: "/c move C:\Windows\Temp\*.foo E:\Foo_blah_blah_blah_blah\Foo2\"