Test environment: C:\>systeminfo | findstr /c:"OS Name" Many people encounter this problem when creating a task schedule to execute a bat file in Windows 2008: the status code returned after the task schedule is executed is 0x1 instead of the normal 0x0 I was also stuck with this problem today and spent almost a day troubleshooting it. Everything works fine when executing the bat script alone, and there is no problem executing the bat script in the Windows 2003 task schedule, but it does not work as long as it is placed in the Windows 2008 task schedule. After searching on domestic and foreign websites, I finally collected all the precautions. The steps are summarized as follows: 1. Confirm that the password of the user who wants to execute the task plan has not expired. If conditions permit, you can set the password to never expire to avoid unnecessary trouble. The Chinese system has a password that never expires option 2. Open the Task Manager, right-click Task Scheduler Library, and select Create Task. Do not select Create Basic Task here. 3. In the General tab, select Run whether user is logged on or not, check Run with highest privileges, and then select Windows Server 2003 from the drop-down list. Do not select Windows Server 2008. The Chinese system corresponds to the following figure 4. There is nothing special in the Triggers tab. Just set the execution time according to your needs. 5. In the Actions tab, fill in the script name in the Program/script input box. Do not include the path here. In the Start in input box, fill in the path where the script is located. Do not add quotation marks here. 6. Add a line at the end of the bat script: Click (here) to collapse or expand
If you do not explicitly specify an exit code, Task Scheduler will assume that the script execution has failed. Versions prior to Window Server 2012 do not require a path to execute scheduled tasks The version after Windows Server 2012 needs to set the path to execute the scheduled task. The batch program can be run normally by double-clicking it, but the error code 0x1 is not reported when it is put into the Windows scheduled task. Cause of the error: The batch script in the program and script has a directory structure, but the path to the directory where the batch script is located is not configured at the start The above is the detailed solution to the problem that the Windows 2008 task plan fails to execute the bat script and returns 0x1. For more information about win2008 bat script fails to return 0x1, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: Summary of Mysql update multi-table joint update method
>>: This article takes you into the world of js data types and data structures
There are many articles about MySQL installation ...
Demand background Part of the data in the busines...
1. Introduction to Middleware 1. Basic concepts E...
This article shares the specific code of JavaScri...
This article uses examples to illustrate the synt...
Download link: Operating Environment CentOS 7.6 i...
Table of contents rem vw Adapt to third-party UI ...
Run the script in debug mode You can run the enti...
Equal height layout Refers to the layout of child...
Table of contents 1. Location Object 1. URL 2. Pr...
Table of contents 1. Introduction 2. Code Impleme...
<br />Some web pages may not look large but ...
Table of contents 1. Shared CommonModule 2. Share...
Table of contents 1. Some points to remember 1. V...
This article example shares the specific code of ...