-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathunblock-dlls.bat
More file actions
58 lines (47 loc) · 1.46 KB
/
unblock-dlls.bat
File metadata and controls
58 lines (47 loc) · 1.46 KB
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
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
echo CPDLC Plugin DLL Unblock Utility
echo ===================================
echo.
echo This script will unblock all DLL files in the current directory and subdirectories.
echo Current directory: %CD%
echo.
:: Count DLL files in current directory and subdirectories
set "dllCount=0"
for /r %%F in ("*.dll") do (
set /a dllCount+=1
)
if %dllCount% equ 0 (
echo No DLL files found in the current directory or subdirectories.
echo.
echo Make sure you have placed this script in the same folder as the CPDLC plugin DLLs.
echo Expected location: Documents\vatSys Files\Profiles\[ProfileName]\Plugins\CPDLCPlugin\
goto :end
)
echo Found %dllCount% DLL file(s) to unblock:
for /r %%F in ("*.dll") do (
echo - %%F
)
echo.
:: Ask for user confirmation
set /p "confirm=Do you want to unblock these DLL files? (Y/N): "
if /i not "%confirm%"=="Y" if /i not "%confirm%"=="YES" (
echo Operation cancelled by user.
goto :end
)
echo.
echo Starting unblock process...
echo.
:: Unblock each DLL file in the current directory and subdirectories
for /r %%F in ("*.dll") do (
echo Unblocking: %%F
:: Use PowerShell to unblock the file
powershell -Command "try { Unblock-File -Path '%%F' -ErrorAction Stop; Write-Host ' Unblocked successfully' } catch { Write-Host ' Failed to unblock: ' $_.Exception.Message }"
)
echo.
echo Unblocking complete!
:end
echo.
echo Press any key to exit...
pause >nul
ENDLOCAL