7z All Folders
7z All Folders is a JScript program that uses 7-Zip to compress every individual folder in the folder in which the script is executed. Each folder is compressed into a 7Z file using optimal compression settings. You must have 7-Zip installed on your computer. If the path is different than the source, simply change the path in the code. This script is similar to 7z All Files.
To use the program, copy and paste the following source code into a file and give it a .js extension, then move the file into the folder you want and double-click it. All folders will be compressed into a 7Z file with the same name as the folder.
Source
// Copyright 2024, Dean Tersigni. // This program 7-zips every file in the executed directory into its own individual 7z file. // It requires that 7-Zip be installed at "C:\Program Files\7-Zip". var oFSO = new ActiveXObject( "Scripting.FileSystemObject" ); var oWSH = new ActiveXObject( "WScript.Shell" ); var sFolder = oWSH.CurrentDirectory; // Get the current folder. var oFolder = oFSO.GetFolder( sFolder ); // Create an object reference to the current folder. var eFolders = new Enumerator( oFolder.SubFolders ); // Create an enumerator on the folders in the current folder. var sFilePath; for( ; !eFolders.atEnd(); eFolders.moveNext() ) { // Loop through the folders. sFolderName = eFolders.item(); // Get the path of the current folder. var sCompressedFile = sFolderName + ".7z"; oWSH.run('"C:\\Program Files\\7-Zip\\7z.exe" a "' + sCompressedFile + '" "' + sFolderName + '\\*" -mx=9', 0, true); } oWSH.Popup("Complete");