title: Batch File try catch
body: <p>I have a batch script with the statement as shown below:</p>
  
  <pre><code>for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^&gt;NUL`) do if '.%%i.'=='.LocalDateTime.' set TIME=%%j
  set TIME=%TIME:~0,12%
  </code></pre>
  
  <p>But once I executed it returned an error which I couldnt understand first. Then got to know the error was because of missing the <strong>wbem</strong> in path env variable. This bat file is located in a central repository so that anyone can execute this. So, need to let the user know the reason if this error strikes again in their local machine.</p>
  
  <p>I dont think there is a try catch statement in Batch. Also, known about ErrorLevel. But I am not sure how this can be implemented..Can anyone support me in this regard..</p>