Does Windows batch support exception handling?

前端 未结 3 558
耶瑟儿~
耶瑟儿~ 2020-12-04 16:11

Does Windows batch programming support exception handling? If not, is there any way to effectively emulate exception handling within batch files?

I would like to be

3条回答
  •  悲哀的现实
    2020-12-04 16:22

    using the successCmd && ( failingCmd & (call ) ) || ( excHandlingCmd ) syntax is quite nice for a lot of cases and does not require any additional files as also described here: https://stackoverflow.com/a/17085933/1915920

    (the dummy (call ) is only for the case the 2nd (last) cmd fails)

提交回复
热议问题