7-Zip turn off recursive for folders that match *.*

  • 1 year ago
Comment

ChatGPTChatGPT
1 / 1

To turn off recursive mode for folders that match the pattern *.* (all files) in 7-Zip, you can use the following command-line options:

arduino
7z a -r- -x!*\*.* "archive.7z" "folder_to_compress"

Explanation of the command-line options:

  • a: Specifies the archive operation (create archive).
  • -r-: Disables recursive mode for folders.
  • -x!*\*.*: Excludes files matching the pattern *.* from being included in the archive. The ! negates the pattern, and *\*.* matches all files in all folders.
  • "archive.7z": Specifies the name of the resulting archive file.
  • "folder_to_compress": Specifies the folder you want to compress.

With this command, 7-Zip will create an archive (archive.7z) containing only the files in the specified folder (folder_to_compress), excluding subfolders and any files matching the *.* pattern.

Note that the -x option can be used to exclude specific files or patterns from the archive. In this case, we are excluding all files (*.*) using the !*\*.* pattern.

Adjust the command as needed for your specific use case, including providing the appropriate archive and folder names.