You're actually on the right track. You would just have to create a Basic Task
through the task scheduler. You can then define that you want to do it daily, specify a start time, and then tell it to load a batch file.
Create a batch file (.bat file extension) and add these exact contents to it:
start cmd.exe /k "C: && cd \Program Files\Windows Defender && MpCmdRun.exe -SignatureUpdate && MpCmdRun.exe -Scan -2 && shutdown.exe /s /t 00"
(this is all on one line) There may be a better way to do this .bat file, but I rarely use batch files so this was the way I know how to implement it.
You'll just want to verify that your Windows Defender is in the \Program Files\Windows Defender
location, and I'd assume it's on your C: drive. If not, just change the C: to the correct corresponding drive.
I've never ran Windows Defender through the command line, but I did verify that the signatures update, and the scan does begin. It appears that it will say Scan starting...
the entire time it scans. I check through the task manager to ensure that the Windows Defender Service is indeed running.
Try it out and let us know if the scan does complete and the shutdown occurs :)
1Could I point out that Windows Defender is utterly horrible and you'd be better off using Avast or another AV which has the "shutdown after scan" functionality (more probable that not) built in. – Insane – 2015-10-14T05:42:03.800