1435thundercloud

DayZ_Mod_Date_Correction

Dec 13th, 2025
45
0
Never
4
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.13 KB | Gaming | 0 0
  1. @echo off
  2. title [3/5] Set folder LastWriteTime = newest .pbo
  3. echo.
  4.  
  5. rem Set console code page to UTF-8 to reduce ASCII artifacts
  6. chcp 65001 >nul
  7.  
  8. echo Updating every mod folder's LastWriteTime to the newest .pbo's LastWriteTime...
  9. pushd "%~dp0"
  10. for /d %%F in (*) do (
  11.     if exist "%%F\addons\*.pbo" (
  12.         for /f "delims=" %%P in ('powershell -Command "Get-ChildItem '%%F\\addons\\*.pbo' | Sort-Object LastWriteTime -Descending | Select-Object -First 1 | ForEach-Object { $_.LastWriteTime.ToString('yyyyMMddHHmmss') }"') do (
  13.             powershell -Command "(Get-Item '%%F').LastWriteTime = [datetime]::ParseExact('%%P','yyyyMMddHHmmss',$null)" >nul 2>&1
  14.             echo %%F  →  %%P
  15.         )
  16.     )
  17. )
  18. echo.
  19. echo All folder LastWriteTime updated!
  20. popd
  21.  
  22. rem Create a manifest.txt with all folder names in the current directory
  23. set "manifestFile=manifest_%date:~10,4%%date:~4,2%%date:~7,2%.txt"
  24. echo Creating %manifestFile% with folder names...
  25.  
  26. rem Loop through directories and write their names into the manifest file
  27. for /d %%D in (*) do (
  28.     echo %%D>> "%manifestFile%"
  29. )
  30.  
  31. echo Manifest created: %manifestFile%
  32. pause
Tags: DayZ
Advertisement
Comments
  • 1435thundercloud
    172 days
    # text 1.03 KB | 0 0
    1. Script Description:
    2.  
    3. This batch script automates maintenance and version identification within a directory containing mod folders:
    4.  
    5. Updates Folder Timestamps:
    6. For each mod folder that contains .pbo files in its addons directory, it finds the newest .pbo file based on its modification time and sets the folder's LastWriteTime to match that file's last modification timestamp.
    7.  
    8. Generates a Manifest File:
    9. Creates a manifest_YYYYMMDD.txt file listing all folder names present in the current directory, serving as a snapshot of the mod structure.
    10.  
    11. Main Goal:
    12. By recording the latest .pbo file's modification date in each folder, the script allows for quick identification of each mod's version based on the year and month of the newest .pbo file. This helps efficiently determine mod freshness or updates at a glance.
    13.  
    14. Additional Notes:
    15. The script sets the console to UTF-8 encoding to properly display special characters and avoid ASCII artifacts.
    16. It streamlines mod management tasks, especially useful for game or software mod directories.
    17.  
    18.  
  • 1435thundercloud
    172 days
    Comment was deleted
  • 1435thundercloud
    172 days
    # text 0.49 KB | 0 0
    1. Additional Note:
    2. This script may fail to update timestamps if mod folders are set to read-only or if there are restricted user access controls (such as UAC) on the drive or folder. To ensure proper operation, run this script within the relevant directories, such as:
    3.  
    4. The !Workshop folder
    5. The ...\Steam\steamapps\workshop\content\221100 folder
    6. Your DayZServer or other mod storage folders
    7.  
    8. Ensure you have the necessary permissions to modify folder timestamps and access all files.
  • 1435thundercloud
    172 days
    # text 0.57 KB | 0 0
    1. rem Non-destructive:
    2. rem This script only updates each @mod folder’s timestamp (Date Modified) to match the newest .pbo file’s creation or modification date.
    3. rem Windows Explorer will then display the folder's date as the latest mod update, allowing for quick sorting and organization by year and month.
    4. rem
    5. rem Why? Workshop mods are frequently updated, and this helps mod creators and users keep track of the latest versions for backups or archiving.
    6. rem This script does NOT delete, rename, move, or copy any files or folders — it solely updates folder timestamps.
Add Comment
Please, Sign In to add comment