In case you run a batch script by using a scheduled task in windows and the script itself returns an…