Cake.SevenZip.Switches Namespace


This namespace contain types related to running 7zip.

Class Types

Class Summary
BaseBoolSwitch BaseClass for simple boolean switches.
BaseSwitchCollection<T> Base for switches that can be given multiple times. An example is ISupportSwitchExcludeFilenames (-x!*.pdf -x!*.xml) which uses SwitchExcludeFilenameCollection (which implements this BaseCollection) to set multiple SwitchExcludeFilename.

Specifies the overwrite mode during extraction, to overwrite files already present on disk.


Specifies the method of treating wildcards and filenames on the command line.


-t (set Type of archive) switch.

Specifies the type of archive.


-ssw (Compress files open for writing) switch.

Compresses files open for writing by another applications. If this switch is not set, 7-zip doesn't include such files to archive.


-m (Set compression Method) switch.

Specifies the compression method.


-sdel (Delete files after compression) switch.

If -sdel switch is specified, 7-Zip deletes files after including to archive. So it works like moving files to archive. 7-Zip deletes files at the end of operation and only if archive was successfully created.


-an (Disable parsing of archive_name) switch.

Disables parsing of the archive_name field on the command line. This switch must be used with the -ai (Include archives) switch. If you use a file list for your archives, you specify it with the -ai switch, so you need to disable parsing of archive_name field from command line.


-ax (Exclude archive filenames) switch.

Specifies archives to be excluded from the operation. Multiple exclude archive switches are supported.

SwitchExcludeArchiveFilenameCollection A Collection of SwitchExcludeArchiveFilename.

-x (Exclude filenames) switch.

Specifies which filenames or wildcard-names must be excluded from the operation. Multiple exclude switches are supported.

SwitchExcludeFilenameCollection A Collection of SwitchExcludeFilename.
SwitchFullyQualifiedFilePaths -spf (Use fully qualified file paths) switch. (Also, -spf2 for full paths without drive letters.)

Enables the mode that allows to use fully qualified file paths in archives. If -spf switch is not specified, 7-Zip reduces file paths to relative paths when it adds files to archive, and 7-Zip converts paths to relative paths when you extract archive. If -spf switch is specified, 7-Zip doesn't try to process or convert paths.


-ai (Include archive filenames) switch.

Specifies additional include archive filenames and wildcards. Multiple include switches are supported.

SwitchIncludeArchiveFilenameCollection A Collection of SwitchIncludeArchiveFilename.

-i (Include filenames) switch.

Specifies additional include filenames and wildcards. Multiple include switches are supported.

SwitchIncludeFilenameCollection A Collection of SwitchIncludeFilename.

-sns (Store NTFS alternate Streams) switch.

If -sns mode is enabled, 7-Zip processes NTFS Alternate Data Streams for files and folders. Current version of 7-Zip can store NTFS alternate streams only to WIM archives. Note: 7-Zip can't include alternate streams to archives on 32-bit Windows XP and older systems.


-sni (Store NT security information) switch.

Use this switch to store and restore NT (NTFS) security information for files and directories. Note that only NTFS file system supports that feature. Current version of 7-Zip can store NT security information only to WIM archives.


-o (set Output directory) switch.

Specifies a destination directory where files are to be extracted. This switch can be used only with extraction commands.


-ao (Overwrite mode) switch.

Specifies the overwrite mode during extraction, to overwrite files already present on disk.


-p (set Password) switch.

Specifies password.


-r (Recurse subdirectories) switch.

Specifies the method of treating wildcards and filenames on the command line.


-sfx (Create SFX archive) switch.

Specifies the SFX module that will be combined with the archive. This module must be placed in the same directory as the 7z.exe. If {SFX_Module} is not assigned, 7-Zip will use standard console SFX module 7zCon.sfx.


-scrc (Set hash function) switch.

Sets hash function for "extract" and "hash" commands.

SwitchSetHashFunctionCollection A Collection of SwitchSetHashFunction.

-stl (Set archive time-stamp from the most recently modified file) switch.

If -stl switch is specified, 7-Zip sets time-stamp for archive file as time-stamp from the most recently modified file in that archive.


-slt (Show technical information) switch.

Sets technical mode for l (List) command.


-u (Update options) switch.

Specifies how to update files in an archive and (or) how to create new archives.


-v (Create Volumes) switch.

Specifies volume sizes.

SwitchVolumeCollection A Collection of SwitchVolume.

-w (set Working directory) switch.

Sets the working directory for the temporary base archive. By default, 7-Zip builds a new base archive file in the same directory as the old base archive file. By specifying this switch, you can set the working directory where the temporary base archive file will be built. After the temporary base archive file is built, it is copied over the original archive; then, the temporary file is deleted.

UpdateAction Specifies the action for a given SwitchUpdateOptions-State.

VolumeUnit Units for SwitchCompressionMethod.

Interface Types

Interface Summary
ISupportSwitch Interfaces for all switches. Commands "support" switches by implementing an ISupportSwitch (e.g. ISupportSwitchPassword is implemented in all commands that support setting a password (-p).

Command supports switch -t (set Type of archive).

The Switch is SwitchArchiveType.

The Builder is SwitchArchiveTypeBuilder.


Command supports switch -ssw (Compress files open for writing).

The Switch is SwitchCompressFilesOpenForWriting.

The Builder is SwitchCompressFilesOpenForWritingBuilder.


Command supports switch -m (Set compression Method).

The Switch is SwitchCompressionMethod.

The Builder is SwitchCompressionMethodBuilder.


Command supports switch -sdel (Delete files after compression).

The Switch is SwitchDeleteAfterCompression.

The Builder is SwitchDeleteAfterCompressionBuilder.


Command supports switch -an (Disable parsing of archive_name).

The Switch is SwitchDisableParsingOfArchiveName.

The Builder is SwitchDisableParsingOfArchiveNameBuilder.


Command supports switch -ax (Exclude archive filenames).

The Switch is SwitchExcludeArchiveFilenameCollection.

The Builder is SwitchExcludeArchiveFilenamesBuilder.


Command supports switch -x (Exclude filenames).

The Switch is SwitchExcludeFilenameCollection.

The Builder is SwitchExcludeFilenamesBuilder.


Command supports switch -spf/-spf2 (Use fully qualified file paths).

The Switch is SwitchFullyQualifiedFilePaths.

The Builder is SwitchFullyQualifiedFilePathsBuilder.


Command supports switch -ai (Include archive filenames).

The Switch is SwitchIncludeArchiveFilenameCollection.

The Builder is SwitchIncludeArchiveFilenamesBuilder.


Command supports switch -i (Include filenames).

The Switch is SwitchIncludeFilenameCollection.

The Builder is SwitchIncludeFilenamesBuilder.


Command supports switch -sns (NTFS alternate Streams).

The Switch is SwitchNtfsAlternateStreams.

The Builder is SwitchNtfsAlternateStreamsBuilder.


Command supports switch -sni (NT security information).

The Switch is SwitchNtSecurityInformation.

The Builder is SwitchNtSecurityInformationBuilder.


Command supports switch -o (set Output directory).

The Switch is SwitchOutputDirectory.

The Builder is SwitchOutputDirectoryBuilder.


Command supports switch -ao (Overwrite mode).

The Switch is SwitchOverwriteMode.

The Builder is SwitchOverwriteModeBuilder.


Command supports switch -p (set Password) .

The Switch is SwitchPassword.

The Builder is SwitchPasswordBuilder.


Command supports switch -r (Recurse subdirectories).

The Switch is SwitchRecurseSubdirectories.

The Builder is SwitchRecurseSubdirectoriesBuilder.


Command supports switch -sfx (Create SFX archive).

The Switch is SwitchSelfExtractingArchive.

The Builder is SwitchSelfExtractingArchiveBuilder.


Command supports switch -scrc (Set hash function).

The Switch is SwitchSetHashFunction.

The Builder is SwitchSetHashFunctionBuilder.


Command supports switch -slt (Show technical information).

The Switch is SwitchShowTechnicalInformation.

The Builder is SwitchShowTechnicalInformationBuilder.


Command supports switch -stl (Set archive time-stamp from the most recently modified file).

The Switch is SwitchSetTimestampFromMostRecentFile.

The Builder is SwitchSetTimestampFromMostRecentFileBuilder.


Command supports switch -u (Update options).

The Switch is SwitchUpdateOptions.

The Builder is SwitchUpdateOptionsBuilder.


Command supports switch -v (Create Volumes).

The Switch is SwitchVolumeCollection.

The Builder is SwitchVolumeBuilder.

ISupportSwitchWorkingDirectory .

Command supports switch -w (Working directory).

The Switch is SwitchWorkingDirectory.

The Builder is SwitchWorkingDirectoryBuilder.

ISwitch Base for all Switches.