Escort the Win7 system mission plan

  
In daily use, we often use the task plan to automatically complete many tasks, such as automatic backup, background upgrade, etc., but in the actual deployment of Windows 7 task plan, you may often find that the program or batch processing that is executed is accurate, add It cannot be executed after the mission plan. Ask the master how to ensure that the mission plan does not expire. [Solution] The task plan refers to executing a specific program (or batch, script) under certain conditions (such as user login, system startup), and the default task plan is automatically run in the background. Therefore, if the task plan fails, there are two main reasons: First, the called program or the batch code is wrong, causing the task plan to fail to run the specified program. Second, the running account has insufficient permissions, resulting in the task plan not having sufficient permissions to run the specified program. Therefore, the idea of ​​solving the problem is mainly to solve the problem from the perspective of the program (or batch processing) itself and account authority. [Solution Method] Solve the problem caused by the error of the program itself. Because we add the program (or batch) to the task plan, we usually run it in advance. Therefore, most of the errors in the program itself are caused by not specifying the correct path. For example, a batch processing such as the following is placed on the desktop: echo "test is ok!" >>test.txt When we double-click directly on the desktop or run at the command prompt, the batch will be generated in the current directory. The test.txt file indicates that the batch code is error free. However, when we add to the mission plan, after restarting, open “ control panel → management tools “, expand to "system tools → task planner & rarr; task planner library", you can see the added mission plan The prompt "Running", but did not generate the specified "test.txt" file (Figure 1). Why is this problem occurring? When we double-click on the desktop directly or run the above batch at the command prompt, the system automatically assigns the current directory as the directory where the files are stored. The batch processing does not have any problems. But when we add this batch to the task schedule run, the task schedule cannot automatically specify the starting position required to execute the batch, causing the above batch to not take effect. So the solution is to re-specify the correct path for the batch, for example, change to the following code: echo "test is ok!" >>d:\\test.txt In addition, the task plan batch itself The specific path to the call must be specified. For example, the desktop shortcut is called. If you right click on the shortcut and select “Properties → Shortcuts", the "starting position" here; if it is empty, it will also be wrong when running in the task plan. The solution is the same. It is necessary to specify a specific shortcut (Figure 2). Solve the problem caused by insufficient permissions. Everyone knows that if you want to run the program with the shield flag in Windows 7 (even if you are logged in as an administrator), the system will pop up the UAC (User Account Control) prompt, we need to manually lift the right to run. These programs. Therefore, if the task plan is executed (or the task plan execution batch, the script calls) is a program with a shield flag, the UAC of the system will start the interception, which will result in the task plan not being automatically completed in the background. The solution is naturally to perform the program's authorization. In the task plan window, select the task that cannot be run. Under the general option, run the user to select the local administrator account, single-select “ run when the user logs in, and then tick “Run with the highest privilege, so there is no UAC interception the next time you start the above task (Figure 3). However, it should be noted that there are multiple “sessions” mechanisms in Windows. Each user login will generate a new session. Each session runs a different desktop and program, and they are independent. After we can start the task manager, click “View → select column → check the session ID", so that the process list can display the session of each process (Figure 4). If you select "Always run regardless of whether the user is logged in" in the general properties (or run the account is SYSTEM), the task schedule runs on session 0 (current account login is session 1). In the 0 session, we can't see the running program on the current desktop. Therefore, if the task plan is to run a GUI program such as Start Thunder, QQ, you must select the current user to run, otherwise you can select SYSTEM to run, just click “ Change the user and group & rdquo;, then enter “SYSTEM" under "Enter the object name to select" and click “OK> to run the mission plan as SYSTEM (Figure 5). Tip: Many commonly used programs such as Sogou input method font upgrade, Flash plug-in automatic upgrade, disk fragment timing finishing are all carried out through the mission plan, but the system comes with the task planning component can not see all the scheduled tasks, we can go Http://tinyurl.com/l3w8g9rDownload AutoRuns. After running, switch to “Scheduled Tasks” to see all the background tasks of the machine. If the red is marked, the path is wrong and can be deleted manually (Figure 6). Tips: What is a conversation? After the user logs in to the Windows system, regardless of whether the user is logged in locally or remotely logged in, the system assigns a new session ID (SID) to the user. A session is associated with a user's login. It means a running environment after the user logs in, including the desktop, user profiles, assigned permissions, and so on. Microsoft also uses the session to isolate the system kernel (running in session 0) from the user (session 1) to ensure better stability. This article comes from [System Home] www.xp85.com
Copyright © Windows knowledge All Rights Reserved