Created
March 31, 2023 00:50
-
-
Save bitnenfer/9756a7a5989e640fd619459c8b6759b3 to your computer and use it in GitHub Desktop.
Renami zip batch file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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