-
Notifications
You must be signed in to change notification settings - Fork 17
/
JJs_Reset_n_Run_Tool.cmd
73 lines (69 loc) · 2.36 KB
/
JJs_Reset_n_Run_Tool.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
@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=--config config.txt.supportxmr
:: Other Tools. Delete or remark if not used.
SET VidTool1Path=.\
SET VidTool1=OverdriveNTool.exe -p1XMR
::
:: #### 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