A
A
Alexey2020-12-16 10:17:06
Windows
Alexey, 2020-12-16 10:17:06

How to configure the Windows Task Scheduler so that tasks run in the background?

On win 10 pro, you need to periodically add network settings, which are knocked down by group policies every 5 minutes.
You need to run commands like this:

route add 192.168.12.0/24 192.168.17.106
route add 192.168.2.0/24 192.168.17.112
route add 192.168.40.0/24 192.168.17.100
route add 10.168.0.0/16 192.168.17.10
regedit /S D:\ProxyConfig\proxy.reg


In principle, everything works, but every time the commands are executed, the screen blinks 5 times and the focus disappears from the active window. Then, however, it returns, but it still infuriates.

Is there any way to make everything in the background? I checked the "Hidden task" box, but apparently this is not what I need.

5fd9b3f005658582498036.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey, 2020-12-16
@Kubig

Thanks to everyone for the answers, they are all wrong, but thanks to Artem for the suggestion). I set the settings as on the screen and no blinking.
5fd9ee0db9471494145855.png

A
Artem @Jump, 2020-12-16
curated by the

Do you see the checkbox - "execute only for logged in users"?
You are logged in - a task is being executed under your account, and accordingly, a black batch file window flashes on your screen.
Run as a different user - who is not logged in. Since he is not logged in, he does not have a screen on which to see the window flicker.

R
res2001, 2020-12-16
@res2001

At a minimum, you can hide all the commands in 1 batch file and run the batch file, and not the commands one at a time. So your screen will blink 1 time, not 5.
If your proxy.reg is not large, then you can paint it using the command reg /?. I think several reg commands will run faster than one regedit and probably won't blink.
Additionally, you can hide the batch file window using a js / vbs script - google it, this is a simple well-known option. In the task, you will run not a batch file, but this script, and from the script already a batch file.
"Hidden task" - hides the task from the list of tasks in the task manager, and not what you think. To display hidden tasks - View -> Show hidden tasks :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question