Compress all BAK files in folder (and subfolders) with 7-Zip and delete original files
Run to fix
This file contains 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
dir c:\temp\*.bak | ForEach-Object { & "C:\Program Files\7-Zip\7z.exe" a -sdel ($_.DirectoryName+"\"+$_.Name+".7z") ($_.DirectoryName+"\"+$_.Name)} | |
# To do this to all .bak files in all subfolder, just add -Recurse to command: | |
# dir -Recurse c:\temp\*.bak | ForEach-Object { & "C:\Program Files\7-Zip\7z.exe" a -sdel ($_.DirectoryName+"\"+$_.Name+".7z") ($_.DirectoryName+"\"+$_.Name)} |
Kommentarer
Send en kommentar