So.. to sum it up, in order to keep the rig running all the time, after every restart and so on..
First, this is how my Cast XMR folder looks like, with Cast XMR, devcon and OverdriveNTool inside:
https://s18.postimg.org/d456tnk7d/Capture.jpgBelow is the bat file content (Mine.bat, which calls itself when the timer expires). I start numbering the Vegas with r1 and p1 to work with OverdriveNTool because I use the Intel iGPU. If you don't use an iGPU they should be numbered starting from r0 and p0.
cd
devcon.exe disable "PCI\VEN_1002&DEV_687F"
timeout /t 5
devcon.exe enable "PCI\VEN_1002&DEV_687F"
timeout /t 5
OverdriveNTool.exe -r1 -r2 -r3 -r4 -r5 -r6 -p1Vega56 -p2Vega56 -p3Vega56 -p4Vega56 -p5Vega56 -p6Vega56
timeout /t 1
cd
@echo off
echo -------------------------------------------------------------------
echo Restarts the miner every 40 minutes //you can set it to your own liking
echo -------------------------------------------------------------------
echo:
set executable=cast_xmr-vega.exe
set commandline= -G 0,1,2,3,4,5 -S xmr-eu1.nanopool.org:14444 -u YourWalletAddress.RigNameOfYourChoice %*
set runforseconds=2400
set restartinseconds=2
set /a counter=0
timeout 2
:start
start "cast_xmr-vega" %executable% %commandline%
echo:
echo The program is going to run for %runforseconds% seconds
timeout %runforseconds%
taskkill /f /im %executable%
cd
Mine.bat
echo:
echo Restarting the app in %restartinseconds% seconds (%counter%)
timeout %restartinseconds%
set /a counter+=1
echo:
echo:
goto start
If you want your rig running ALL the time without you having to do anything even if you restart Windows or the computer powers off, you can call your own bat when Windows starts and you can automate the login process in Windows, following these steps:
Step 1: Configure BIOS Settings to power on the computer automatically if for whatever reason power is lostBefore we even get to Windows, make sure your mining computer’s BIOS settings are in order. Power on your computer, and press the “delete” key a few times immediately after power on. You should end up in the BIOS configuration area. Do the following, then save & exit:
Change power options so that the computer automatically turns itself on whenever power is restored. The reason for this is two-fold: first, it’ll make sure that your miner automatically starts up after a power outage. Second, it makes powering the computer on much easier if you don’t happen to have a power switch connected to the motherboard.
Disable all components that you don’t plan to use. This might save a little bit of power, and since your miner will likely be running 24/7, it’ll add up. For me, that meant disabling onboard audio, the USB 3.0 ports, one of the SATA controllers, the Firewire port, and the serial port.
If you’re running a lot of GPUs (4+), additional tweaks might be necessary to ensure that they’re all recognized by the OS. Exact tweaks vary by motherboard, but setting the PCIe speed to Gen1 is usually a good place to start. No need to change anything now, but make a mental note that you may need to come back and play around a bit if all of your GPUs don’t show up in the OS later.
Step 2: Configure automatic loginIf you’re building a dedicated mining rig, then you probably want your mining rig to boot up and start mining automatically, without any user intervention. We’ll need to enable auto-login for that to be possible.
Right-click on the Start Menu and select “Run”. Type “netplwiz” (without the quotes) at the prompt, and click “ok”.
Uncheck the box that says “Users must enter a user name and password to use this computer”.
Click “Apply”. You’ll be prompted to enter your password to confirm the change.
Step 3: Configure your miner to start automaticallyWe want our rig to automatically start mining whenever it’s powered on or rebooted. That way, we keep mining losses to a minimum whenever a power outage occurs, and we don’t have to worry about manually starting it back up in other situations.
Open Windows Explorer and navigate to the folder where you created “mine.bat” in the previous step.
Right-click on your mine.bat file, and pick “Copy”.
Now, navigate to %AppData%\Microsoft\Windows\Start Menu\Programs\Startup (should be something like C:\Users\[YOUR WINDOWS USERNAME]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup).
Right-click anywhere on the empty background of the Startup folder and select “Paste shortcut”.
You should see a shortcut to your mine.bat file appear in the startup folder. Windows should automatically execute it upon bootup.
Note: This simple methods don't deal with hash rate drops you can experience when switching the VGA output on your iGPU and so on, there is the JJ script for that, but I don't experience that. This mostly works for rigs running 24/7 at home or remotely via Chrome Remote Desktop.
Just wanted to say thank you for this mate; had most of the steps automated myself, other than the auto-restart which I now have from you, so thanks again!