-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSteamworkshopcmd.bat
More file actions
59 lines (51 loc) · 2.2 KB
/
Steamworkshopcmd.bat
File metadata and controls
59 lines (51 loc) · 2.2 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
@echo off
:: Auto-detect SteamCMD path
for /f "tokens=*" %%A in ('where steamcmd 2^>nul') do set "STEAMCMD_PATH=%%A"
if not defined STEAMCMD_PATH (
echo ERROR: SteamCMD not found. Please set the path manually.
set /p STEAMCMD_PATH="Enter the full path to steamcmd.exe: "
)
:: Auto-detect Arma 3 installation directory
for /f "tokens=*" %%A in ('reg query "HKCU\Software\Valve\Steam\Apps\107410" /v InstallDir 2^>nul ^| find /i "InstallDir"') do set "ARMA3_DIR=%%B"
if not defined ARMA3_DIR (
echo ERROR: Arma 3 directory not found in registry. Please set the path manually.
set /p ARMA3_DIR="Enter the full path to your Arma 3 installation directory: "
)
:: Set mods directory based on Arma 3 directory
set "ARMA3_MODS_DIR=%ARMA3_DIR%\!Workshop"
if not exist "%ARMA3_MODS_DIR%" mkdir "%ARMA3_MODS_DIR%"
:: Allow user to override directories
echo Current directories:
echo - SteamCMD: %STEAMCMD_PATH%
echo - Arma 3: %ARMA3_DIR%
echo - Mods: %ARMA3_MODS_DIR%
set /p CUSTOMIZE="Do you want to customize these paths? (Y/N): "
if /i "%CUSTOMIZE%"=="Y" (
set /p STEAMCMD_PATH="Enter the full path to steamcmd.exe: "
set /p ARMA3_DIR="Enter the full path to your Arma 3 installation directory: "
set /p ARMA3_MODS_DIR="Enter the full path to your mods directory: "
)
:: Set workshop mods temporary download directory
set "INSTALL_DIR=%ARMA3_DIR%\WorkshopDownloads"
if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%"
:: Check for workshop IDs file
set "WORKSHOP_ID_FILE=workshop_ids.txt"
if not exist "%WORKSHOP_ID_FILE%" (
echo ERROR: %WORKSHOP_ID_FILE% not found.
pause
exit /b
)
:: Process each Workshop ID
for /f "usebackq tokens=*" %%i in ("%WORKSHOP_ID_FILE%") do (
echo Downloading mod with Workshop ID: %%i
%STEAMCMD_PATH% +login anonymous +force_install_dir "%INSTALL_DIR%" +workshop_download_item 107410 %%i +quit
:: Move mod to Arma 3 mods directory
if exist "%INSTALL_DIR%\steamapps\workshop\content\107410\%%i" (
echo Moving mod %%i to Arma 3 mods directory.
xcopy /E /I /Y "%INSTALL_DIR%\steamapps\workshop\content\107410\%%i" "%ARMA3_MODS_DIR%\%%i"
) else (
echo ERROR: Mod %%i not found in the download directory.
)
)
echo All mods processed.
pause