A
A
Anatoly Belousov2021-11-20 09:08:53
cmd/bat
Anatoly Belousov, 2021-11-20 09:08:53

How to implement exception handling in CMD?

How to do exception handling in CMD?
In python like this:

try:
  ... 
  print("Ошибок нет! ") 
except:
  print("Ошибка!")

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergio, 2021-11-20
@no_name_774

Check the status of the last executed command through errorlevel
if errorlevel echo "Error!"
I found an article on this topic: https://habr.com/ru/post/41028/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question