0x2 Scheduled Task Error Code
Contents |
be down. Please try the request again. Your cache administrator is webmaster. Generated Sun, 02 Oct 2016 18:06:36 GMT by s_hv978 (squid/3.5.20)
Tricks I recently had a task job scheduled in one of Windows server 2008 but kept getting a return server 2008 task scheduler 0x2 result code 2 every time it runs. Task Scheduler successfully completed task "\RoomView"
Action "c:\windows\system32\cmd.exe" With Return Code 2.
, instance "{fcc8337a-11b2-4e69-b101-a58bb8d18ead}" , action "C:\Windows\SYSTEM32\cmd.exe" with return code 2. Obviously, even though it says Task Scheduler successfully 0x2=0 completed task, the task didn't complete what it supposed to do. The return code 2, as part of the cmd command exit code, indicates that The system cannot find http://answers.microsoft.com/en-us/windows/forum/windows_7-performance/scheduled-task-returns-0x2/8778cc36-9e4b-4871-9482-6cb9a7e9dce6 the file specified, meaning that the file in task cannot be found in specified location. It doesn't seem to be the case in the task I've scheduled. I had made sure all files are in the location where it belongs. And I can run the task manually outside the task scheduler. The only explanation why the scheduler threw this exit http://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/ code is probably the security setting. Since I already set the task run under the admin account, I enforced it to run with the highest privileges, the option under General tab in task properties, just like Run as administrator. And bingo, now I am finally getting 0 as the return code now, stating that program successfully completed. You may also likeSending Authenticated Email in ASP.net 3.5 (0)Send Authenticated Email in ASP.Net 2.0 (0)[Stupidity] re-enable a disabled local administrator account in Windows (0)Rename A Batch of Files with PowerShell (0)Word Tip: Insert A File in A Word Document (1) Task Scheduler 4 Responses to "Why my scheduled task completes with return code 2" Thomas Thomassen says: June 17, 2012 at 7:47 am I had an issue when I need to use net use to mount a drive with the SYSTEM account so it would be availible to CrashPlan. Under Win7 (admin no UAC) it was no problem, under Vista (admin with UAC) I got return code 2. I had to uncheck the "Run with highest priveledges" check
Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join https://www.experts-exchange.com/questions/28683848/Task-Scheduler-0x2-error.html Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Task Scheduler 0x2 error Want to Advertise Here? Solved Task Scheduler 0x2 error Posted on 2015-06-02 Windows Batch Windows Server 2008 Scripting Languages 1 Verified Solution 2 Comments 1,390 Views Last Modified: 2015-06-02 Dear Experts I have a batch file to FTP a file to a remote server - this is run in Task Manager, however it always returns scheduled task a 0x2 error. If I manually run the batch file it works perfectly. Can anyone offer any suggestions? Thanks 0 Question by:grantballantyne Facebook Twitter LinkedIn Google LVL 82 Active today Best Solution byoBdA 2 is usually "file not found". Did you provide the full path to your batch file in Task Scheduler? Did you set the "Start in" path in Task Scheduler to the folder with the script? Are the scripts and/or Go to Solution 2 Comments 0x2 scheduled task LVL 29 Overall: Level 29 Windows Server 2008 12 Scripting Languages 1 Message Active today Expert Comment by:Rich Weissler2015-06-02 Check the permissions / user context under which the file is running in Task Manager. Assuming it isn't under the same permissions you are connected to the desktop, try opening up a cmd session as the other user (Control-Shift-rightclick -- 'run as different user') and see if the batch file works as expected as the other user. Could be permissions or a directory that doesn't exist in the other user context. 0 LVL 82 Overall: Level 82 Windows Batch 26 Windows Server 2008 19 Scripting Languages 16 Message Active today Accepted Solution by:oBdA2015-06-02 2 is usually "file not found". Did you provide the full path to your batch file in Task Scheduler? Did you set the "Start in" path in Task Scheduler to the folder with the script? Are the scripts and/or parts of it (config files, ftp scripts, ...) coming from a network drive, and if so ... ... did you use the UNC instead of a drive letter? ... does the account running the script have permissions to access the network resource? 0 Write Comment First Name Please enter a first name Last Name Please enter a last name Email We will never share this with anyone. Comment Submit Your Comment By clicking you are agreeing to Experts E