Skip to content

Instantly share code, notes, and snippets.

@bitnenfer
Created March 31, 2023 00:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitnenfer/9756a7a5989e640fd619459c8b6759b3 to your computer and use it in GitHub Desktop.
Save bitnenfer/9756a7a5989e640fd619459c8b6759b3 to your computer and use it in GitHub Desktop.
Renami zip batch file
@echo off
setlocal enabledelayedexpansion
for %%f in (*.zip.*) do (
set "filename=%%f"
if /i not "!filename:~-4!"==".zip" (
echo Renaming !filename! to !filename!.zip
ren "!filename!" "!filename!.zip"
) else (
set "restoredFilename=!filename:~0,-4!"
echo Restoring zip file !restoredFilename!
ren "!filename!" "!restoredFilename!"
)
)
endlocal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment