-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall_mql5.bat
More file actions
61 lines (50 loc) · 1.52 KB
/
Copy pathinstall_mql5.bat
File metadata and controls
61 lines (50 loc) · 1.52 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
59
60
61
@echo off
setlocal enabledelayedexpansion
REM Set path to the library source folder
set "SRC_LIB=MQL5\Include"
set "SRC_EXAMPLES=MQL5\Scripts"
REM Check if source exists
if not exist "%SRC_LIB%" (
echo [×] Library folder not found: %SRC_LIB%
goto end
)
if not exist "%SRC_EXAMPLES%" (
echo [×] Example folder not found: %SRC_EXAMPLES%
goto end
)
echo [*] Scanning for installed MetaTrader terminals...
REM Set base directory where MT5 terminals are located
set "BASE=%APPDATA%\MetaQuotes\Terminal"
REM Iterate over subdirectories (terminals)
for /D %%T in ("%BASE%\*") do (
set "DST_LIB=%%T\MQL5\Include"
set "DST_EXAMPLES=%%T\MQL5\Scripts"
REM Copy library files
if exist "!DST_LIB!" (
echo [→] Installing to: !DST_LIB!
xcopy /e /i /y "%SRC_LIB%" "!DST_LIB!" >nul
if errorlevel 1 (
echo [✓] Installed successfully to: !DST_LIB!
) else (
echo [×] Copy failed for: !DST_LIB!
)
) else (
echo [×] Skipping %%T — No MQL5\Include folder
)
REM Copy example scripts
if exist "%%T\MQL5\Experts" (
echo [→] Installing examples to: !DST_EXAMPLES!
xcopy /e /i /y "%SRC_EXAMPLES%" "!DST_EXAMPLES!" >nul
if errorlevel 1 (
echo [✓] Example installed to: !DST_EXAMPLES!
) else (
echo [×] Example copy failed for: !DST_EXAMPLES!
)
) else (
echo [×] Skipping examples for %%T — No MQL5\Experts folder
)
)
:end
echo.
pause
endlocal