Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :: BatchGotAdmin
- :: https://stackoverflow.com/questions/1894967/how-to-request-administrator-access-inside-a-batch-file
- ::-------------------------------------
- REM --> Check for permissions
- >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
- REM --> If error flag set, we do not have admin.
- if '%errorlevel%' NEQ '0' (
- echo Requesting administrative privileges...
- goto UACPrompt
- ) else (
- goto gotAdmin
- )
- :UACPrompt
- echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
- set params = %*:"="
- echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
- "%temp%\getadmin.vbs"
- del "%temp%\getadmin.vbs"
- exit /B
- :gotAdmin
- pushd %~DP0
- ::--------------------------------------
- TITLE JJs Reset and Run Tool for Vega
- ::
- :: Author: TheJerichoJones on GitHub
- ::
- :: Resets the Vega driver
- :: Runs whatever Miner you like with the options you define
- :: Run whatever VidTool you like with the options you define
- :: Waits for input
- :: Repeats the process
- ::
- :: #### Begin Variables ####
- ::
- :: Needs trailing backslash for MinerPath and VidTool1Path.
- :: Don't quote the path even if it has spaces. That is done at runtime.
- :: Actually don't quote any of these settings.
- ::
- SET MinerPath=.\
- SET MinerEXE=xmr-stak.exe
- SET MinerName=%MinerEXE:.EXE=%
- ::SET MinerOpts=-S 104.154.164.183:3333 -u HomeRig0 -G 0,1,2,3,4,5,6 -a 0 --ratewatchdog
- :: Other Tools. Delete or remark if not used.
- ::SET VidTool1Path=.\
- ::SET VidTool1=OverdriveNTool.exe -r1 -r2 -r3 -r4 -r5 -r6 -r7 -p1Vega56M -p2Vega56M -p3Vega56M -p4Vega56M -p5Vega56M -p6Vega56M -p7Vega56M
- ::
- :: #### End Variables ####
- ::
- :Start
- START /W PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-PnpDevice| where {$_.friendlyname -like 'Radeon RX Vega'} | Disable-PnpDevice -ErrorAction Ignore -Confirm:$false | Out-Null}"
- TIMEOUT /t 5
- START /W PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-PnpDevice| where {$_.friendlyname -like 'Radeon RX Vega'} | Enable-PnpDevice -ErrorAction Ignore -Confirm:$false | Out-Null}"
- IF DEFINED VidTool1 (
- START /W %VidTool1Path%%VidTool1%
- )
- Start "JJs Reset and Run Tool for Vega running %MinerName%" "%MinerPath%%MinerEXE%" %MinerOpts%
- CLS
- echo.
- echo ****************************************
- echo * Press any key to restart the script. *
- echo ****************************************
- echo.
- pause>nul
- echo.
- Taskkill /im %MinerEXE% /f
- echo.
- Goto :Start
- POPD
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement