Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - @echo off
- :: Get the current directory (where the script is running from)
- set "currentDir=%~dp0"
- :: ------------------------
- :: XaeroWaypoints Directory
- :: ------------------------
- :: Set the target directory for XaeroWaypoints
- set "waypointsDir=%currentDir%XaeroWaypoints\Folder_name_here"
- :: Change directory to the XaeroWaypoints target directory
- cd /d "%waypointsDir%"
- :: Find the most recent folder matching the pattern "dim%the_vault$vault_"
- set "mostRecentWaypointFolder="
- for /f "delims=" %%f in ('dir /ad /b /o-d dim%%the_vault$vault_*') do (
- if not defined mostRecentWaypointFolder set "mostRecentWaypointFolder=%%f"
- )
- :: Loop through and delete folders that match the pattern "dim%the_vault$vault_" except the most recent one
- for /d %%f in (dim%%the_vault$vault_*) do (
- if "%%f" neq "%mostRecentWaypointFolder%" (
- echo Deleting folder in XaeroWaypoints: %%f
- rd /s /q "%%f"
- )
- )
- :: ------------------------
- :: XaeroWorldMap Directory
- :: ------------------------
- :: Set the target directory for XaeroWorldMap
- set "worldMapDir=%currentDir%XaeroWorldMap\Folder_name_here"
- :: Change directory to the XaeroWorldMap target directory
- cd /d "%worldMapDir%"
- :: Find the most recent folder matching the pattern "the_vault$vault_"
- set "mostRecentWorldMapFolder="
- for /f "delims=" %%f in ('dir /ad /b /o-d the_vault$vault_*') do (
- if not defined mostRecentWorldMapFolder set "mostRecentWorldMapFolder=%%f"
- )
- :: Loop through and delete folders that match the pattern "the_vault$vault_" except the most recent one
- for /d %%f in (the_vault$vault_*) do (
- if "%%f" neq "%mostRecentWorldMapFolder%" (
- echo Deleting folder in XaeroWorldMap: %%f
- rd /s /q "%%f"
- )
- )
- :: Exit the script
- exit
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment                    
                 
                    