Windows – Scheduling silent hourly Windows Defender definition updates using Task Scheduler on Windows 8

windows 8windows task schedulerwindows-defender

I want to update Windows Defender's definitions every hour and came up with the idea of using the Task Scheduler to execute the Defender update service with the signature update argument.

~/Windows Defender/MpCmdRun -SignatureUpdate

This works pretty well but opens up a cmd window every hour and I want to run it silently in the background.

I am aware of the registry mod that can be done to increase the update frequency but do not want to do that hack over and over again after critical Defender updates after which the registry goes back to the original settings.

I am not very familiar with cmd arguments. I know that some executables work with the /silent argument for background launching, but it doesn't help. What else can I try or use?

Best Answer

Use a VBS file instead of a CMD file and schedule it as usual with your Task Scheduler.

VBScript's run method can open other programs in a hidden window via its second argument (, 0). The tricky part was the escaping together with the argument -SignatureUpdate

set objShell = createobject("wscript.shell")  
objShell.Run("""C:\Program Files\Windows Defender\MpCmdRun.exe"" ""-SignatureUpdate""") , 0

Now you won't see any window during Windows Defender update. Only a task manager process is visible:

enter image description here


Other possible settings for intWindowStyle:

0 = Hide the window and activate another window.
1 = Activate and display the window. (restore size and position).
2 = Activate & minimize.
3 = Activate & maximize.
4 = Restore. The active window remains active.
5 = Activate & Restore.
6 = Minimize & activate the next top-level window in the Z order.
7 = Minimize. The active window remains active.
8 = Display the window in its current state. The active window remains active.
9 = Restore & Activate. Specify this flag when restoring a minimized window.
10 = Sets the show-state based on the state of the program that started the application.

Related Question