forked from StarCoreSE/SCModRepository-Dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremove-semods-symlinks.bat
More file actions
39 lines (33 loc) · 995 Bytes
/
remove-semods-symlinks.bat
File metadata and controls
39 lines (33 loc) · 995 Bytes
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
@echo off
setlocal enabledelayedexpansion
:: Check if the script is running with administrative privileges
NET SESSION >NUL 2>&1
if %ERRORLEVEL% NEQ 0 (
echo Please run this script as administrator!
pause
exit /b 1
)
set "targetDir=%APPDATA%\SpaceEngineers\Mods"
set "desktopDir=%USERPROFILE%\Desktop\SpaceEngineersModsBackup"
:: Creating desktop directory if it doesn't exist
if not exist "%desktopDir%" (
mkdir "%desktopDir%"
)
:: Copying non-symbolic link folders to the desktop
for /d %%i in ("%targetDir%\*") do (
set "folderName=%%~nxi"
fsutil reparsepoint query "%%i" > nul 2>&1
if errorlevel 1 (
robocopy "%%i" "%desktopDir%\!folderName!" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
)
:: Removing symbolic links from the mod folder
for /d %%i in ("%targetDir%\*") do (
set "folderName=%%~nxi"
fsutil reparsepoint query "%%i" > nul 2>&1
if not errorlevel 1 (
rmdir /s /q "%%i"
echo Removed symlink in "%%i"
)
)
pause