Scripting: How to detect when a scan is done?
I want to run a series of maintenance actions in the middle of the night, using Wake On LAN to turn on machines, run a script of things to do, and then turn off the target machine when the tasks are complete. This includes things like full-disk defragmenting, which can take a long time.
One of the tasks I want to do is run a full antivirus scan in the middle of the night so that users are never inconvenienced with slow performance due to the full scan or startup scan running during the daytime hours.
I do see that you can run a scan from the command line using "DoScan.exe" but it doesn't wait for the job to complete, but instead DoScan.exe immediately exits and runs the job in the background.
I want to do a "foreground scan" from the command line so that the prompt doesn't return until the task is done, so that a script can then run "shutdown /s /t 60" following the scan.