0

I have a python script that i run via a batch script, at the end i send an email containing a log file and i want to condition my sending emails. if the python script is okay, send an email saying : OK If the python script failed send the log file.

Mar
  • 419
  • 1
  • 7
  • 19
  • 3
    Why don't you do it all with PowerShell? Certainly because the method your using to get the date and time in your batch file, are PC/User/Locale dependent. – Compo Dec 16 '19 at 14:47

1 Answers1

2

I'm not well versed in cmd, but in theory, you should check the status code of your python script if its anything other than 0 it failed

How do I get the application exit code from a Windows command line?

Ron Serruya
  • 3,988
  • 1
  • 16
  • 26