How to hide an execution window in a Windows Task Plan
Note: [task plan] is sometimes called a [scheduled task] and is commonly called a Windows scheduled task. In fact, the name of a scheduled task is actually [task plan]. Please refer, images and truth
When I was working on a project, I encountered a problem that was not a problem. I didn't hide the execution interface "small black window". The program would do the same. But if someone operates on this computer at the same time, if you accidentally close the black window of execution by mistake, a problem occurs, especially in the production environment,
So try several ways to solve this problem:
Method 1: Log On with different accounts
For example, if the currently logged-on user is administrator, you can create a user named Jack and select this user when changing the user or group,
You do not need to log on to this account when logging on. The "small black window" will not appear during each execution. Note: At this time, you must select [run regardless of whether the user logs on or not ],
Otherwise, the task plan will not be executed.
Of course, you can also use the [System] permission when changing users or groups so that you do not have to switch back and forth between user logon.
Method 2: run the VBS script,
The following two scripts can be executed,
Script 1:
DIM objShellset objShell=wscript.createObject("wscript.shell")iReturn=objShell.Run("cmd.exe /C D:\Files\APPService\AppReader.exe", 0, TRUE)
[D: \ Files \ APPService \ AppReader.exe] is the exe file to be executed.
To hide a window, you only need to set the second parameter of Run to 0, and set display to 1;
Script 2
Set WinScriptHost = CreateObject("WScript.Shell")WinScriptHost.Run Chr(34) & "D:\Files\APPService\AppReader.exe" & Chr(34), 0Set WinScriptHost = Nothing
To hide a window, you only need to set the second parameter of Run to 0, and set display to 1;
Configuration example:
Set the execution interval as needed:
Perfect solution!
There are many ways to set form hiding. This is for your reference only.
If you have a good method, please let us know.