1

I'm trying to make a batch script for running multiple command line antivirus scans in a specific order.

I use it this way:

echo Running Sophos virus scan...
start "Sophos Scan" /wait /d "%~dp0sophos" SVRTcli.exe -yes >>%~dp0logs\sophoslog.txt

This will popup a new console window running sophos and wait till it's done.

If I close the new console window, the main window of my batch file will prompt for terminating the batch script. I want to avoid it and just automatically continue with my next command which is similar to the previous (different anti virus engine).

Is it possible? I tried with various solutions on the net. Every time it's the same result. You close the new console and it comes up on your batch cmd.

Eryk Sun
  • 33,190
  • 5
  • 92
  • 111
Vassiliev
  • 11
  • 2
  • [May I suggest this, Running a CMD or BAT in silent mode](https://stackoverflow.com/questions/411247/running-a-cmd-or-bat-in-silent-mode)? – blaze_125 Sep 25 '17 at 21:06
  • I don't want to be silent or in the background. I want to have the ability to close the first scan and move to the next one without any other interaction with the first cmd window. Let's say something went wrong with sophos and its cmd collapsed. I want the script to proceed unattented..... – Vassiliev Sep 25 '17 at 21:26
  • `echo n|start "Sophos Scan" /wait ...` – Ansgar Wiechers Sep 25 '17 at 22:04
  • Yes...that did the job.... Thank you @AnsgarWiechers – Vassiliev Sep 25 '17 at 22:11
  • 1
    Possible duplicate of [Batch files can not supress "terminate job"](https://stackoverflow.com/questions/31866091/batch-files-can-not-supress-terminate-job) – Eryk Sun Sep 26 '17 at 02:12
  • @eryksun But far better solution.... – Vassiliev Sep 26 '17 at 09:46

0 Answers0