He was asking for a code to auto restart miner when it crashes. When hsrminer crashes:
when miner crashes with werfault windows it mean some gfx card(s) is high overclocked and need to down overclocking. werfault can be handled via bat file. and werfault can be disabled.