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
Table of contents 1 Difference 1.1 Space Occupanc...
Preface: I reinstalled win10 and organized the fi...
The drag function is mainly used to allow users t...
A style sheet describes how a document should be ...
Table of contents 1. Basic storage of files and d...
This article example shares the specific code of ...
Table of contents First Look Index The concept of...
This article introduces the sample code of CSS to...
This article example shares the specific code of ...
Table of contents 1. Particle Effects 2. Load the...
In-depth understanding of this in Js JavaScript s...
Preface Recently our server was attacked by hacke...
The answer you often hear is that using a NULL va...
Table of contents 1. What is Javascript? 2. What ...
Preface PIPE, translated as pipeline. Angular pip...