File tree Expand file tree Collapse file tree 1 file changed +41
-11
lines changed Expand file tree Collapse file tree 1 file changed +41
-11
lines changed Original file line number Diff line number Diff line change @@ -4,20 +4,50 @@ echo By Patrick Trumpis (https://github.com/ptrumpis/OpenCL-AMD-GPU)
4
4
echo Inspired by https://stackoverflow.com/a/28407851
5
5
echo :
6
6
7
- %SYSTEMDRIVE%
8
- cd %SYSTEMROOT%
9
- cd system32
7
+ > nul 2 >& 1 " %SYSTEMROOT% \System32\cacls.exe" " %SYSTEMROOT% \System32\config\system" && (
8
+ goto :run
9
+ ) || (
10
+ echo Execution stopped
11
+ echo ==================
12
+ echo This script requires administrator rights.
13
+ echo Please run it again as administrator.
14
+ echo You can right click the file and select 'Run as administrator'
10
15
16
+ echo :
17
+ pause
18
+ exit /b 1
19
+ )
20
+
21
+ :run
11
22
SET ROOTKEY = HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors
12
23
13
24
SETLOCAL EnableDelayedExpansion
14
- FOR /r %%x IN (*amdocl*dll) DO (
15
- SET FILE = " %%x "
16
- reg add %ROOTKEY% /v %%x /t REG_DWORD /d 0 /f
17
-
18
- IF !ERRORLEVEL! == 0 (
19
- echo Added: !FILE!
20
- echo :
21
- )
25
+
26
+ echo Now scanning your PATH for amdocl.dll files, please wait...
27
+ echo :
28
+
29
+ for %%a in (" %path:; =";" % " ) do (
30
+ if " %%~a " neq " " (
31
+ cd /D %%a
32
+ for /r %%f in (*amdocl*dll) do (
33
+ set FILE = " %%~dpnxf "
34
+ echo Found: !FILE!
35
+
36
+ reg query %ROOTKEY% /v !FILE! > nul 2 >& 1
37
+
38
+ if not !ERRORLEVEL! == 0 (
39
+ reg add %ROOTKEY% /v !FILE! /t REG_DWORD /d 0 /f
40
+
41
+ IF !ERRORLEVEL! == 0 (
42
+ echo Added: !FILE!
43
+ )
44
+ )
45
+ )
46
+ )
22
47
)
48
+
49
+ echo :
50
+ echo Done.
51
+ echo :
23
52
pause
53
+ exit /b 0
You can’t perform that action at this time.
0 commit comments