Skip to content

Instantly share code, notes, and snippets.

@gioxx
Created January 30, 2025 15:19
Show Gist options
  • Save gioxx/8c75e19a59d6ff352381c10013e2b766 to your computer and use it in GitHub Desktop.
Save gioxx/8c75e19a59d6ff352381c10013e2b766 to your computer and use it in GitHub Desktop.
Batch che rinomina i file PDF ottimizzati da Stirling PDF, rimuovendo loro il "_Optimized" che hanno in coda al nome del file originale.
@echo off
:: GSolone, 2025
:: Rinomina i file PDF ottimizzati tramite Stirling-PDF e toglie dal nome "_Optimized"
:: Inserisci questo file batch nella cartella contenente i file PDF e lancialo. Spostalo ovunque tu ne abbia necessità.
setlocal enabledelayedexpansion
set "findWord=_Optimized"
for %%F in (*) do (
set "oldName=%%F"
set "newName=!oldName:%findWord%=!"
if not "!oldName!"=="!newName!" ren "%%F" "!newName!"
)
echo Fatto.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment