How to Restart a BAT file on Windows at an Interval


I recently wrote one .bat script on windows to mine Ethereum when i am not using my gaming pc to fragment noobs. I have a friend who also tries to recall cryptocurrencies, but their machines have AMD processors; once in a while the processor and the mining run start to struggle and all the mining stops.

To have mining .exe Stop the work but do not kill the process is a really frustrating problem. I thought it was a Windows sleep / hibernation issue, but the solution I wrote about in this post did not resolve the issue. I went with the second best solution: to kill and restart the process after a given time:

:loop
start PhoenixMiner.exe -pool us1.ethermine.org:4444 -pool2 us1.ethermine.org:4444 -wal WALLET_ADDRESS -proto 3
echo "-------------------------------MINER STARTED"
timeout /t 3600 >null
echo "-------------------------------MINER TERMINATED, RESTARTING"
taskkill /f /im "PhoenixMiner.exe" > null
goto loop

This script kills the process and restarts it after one hour, regardless of whether mining is running smoothly or has stopped. This is obviously not a perfect solution; a better answer would be to create a script to listen for an error and restart the process immediately. I would argue that it is a workable solution so that mining is not down for an entire night!

Monitoring site performance
Monitoring site performance
Monitoring site performance
  • From webcam to animated GIF: the secret behind chat.meatspac.es!
  • CSS @ supports

    CSS @ supports

    Function detection via JavaScript is a best practice on the client side and for all the right reasons, but unfortunately the same functionality has not been available in CSS. What we end up doing is repeating the same properties multiple times with each browser prefix. Yuck. Another thing we …

  • Create a dynamic table of contents using MooTools 1.2

    Create a dynamic table of contents using MooTools 1.2

    You’ve probably noticed that I shy away from writing really long articles. Here are a few reasons why: Most site visitors come from Google and just want a direct point, bail-me-out ASAP answer to a question. I’ve noticed that I’m having a hard time …

  • Link Nudging Using Dojo

Leave a Comment