-t (set Type of archive) switch
Specifies the type of archive.
Syntax
-t{archive_type}[:s{Size}][:r][:e][:a]
- {archive_type}
- Specifies the type of archive. It can be: *, #, 7z, xz, split, zip, gzip, bzip2, tar, ....
- *:r
- Default mode. 7-Zip opens archive and subfile, if it's supported by format.
- *
- Opens only one top level archive.
- *:s{Size}[b | k | m | g]
- Sets upper limit for start of archive position. Default scan size is 8 MBytes "*:s8m". Example: "*:s0" means that it will open only file that has no any stub before archive.
- #
- Opens file in Parser mode, and ignores full archives.
- #:a
- Same as *, but it opens files with unknown extensions that contain archives in Parser Mode.
- #:e
- Opens file in Parser mode and checks all byte positions as start of archive.
If -t{archive_type} switch is not specified, 7-Zip uses extension of archive filename to detect the type of archive. If you create new archive, -t{archive_type} switch is not specified and there is no extension of archive, 7-Zip will create .7z archive.
If -t{archive_type} switch is not specified and archive name contains incorrect extension, the program will show the warning.
It's possible to use the combined type (for example, mbr.vhd) for "Extract" and "List" commands for some archives.
When you extract archive of some types that contains another archive without compression (for example, MBR in VHD), 7-Zip can open both levels in one step. If you want to open/extract just top level archive, use -t* switch.
Note: xz, gzip and bzip2 formats support only one file per archive. If you want to compress more than one file to these formats, create a tar archive at first, and then compress it with your selected format.
Example
7z a -tzip archive.zip *.txt
adds all *.txt files from current directory to zip archive archive.zip.
7z t -t7z.split archive.7z.001
tests all files in archive.7z.001. It also checks that archive is multivolume .7z archive.
7z x -t# sfxarchive.exe
extracts sfxarchive.exe in parser mode.
7z x -tiso archive.iso
extracts files from archive.iso open as ISO archive.
7z x -tudf archive.iso
extracts files from archive.iso open as UDF archive.
Commands that can be used with this switch
a (Add), d (Delete), e (Extract), l (List), t (Test), u (Update), x (Extract with full paths)
Other documents on this site:
- 7-Zip Manual /Methods.txt
- 7-Zip Manual /unRarLicense.txt
- 7-Zip Manual /copying.txt
- 7-Zip Manual /License.txt
- 7-Zip Manual /7zFormat.txt
- 7-Zip Manual /src-history.txt
- 7-Zip Manual /readme.txt
- 7-Zip Manual /lzma.txt
- 7-Zip Manual /7zC.txt
- 7-Zip Start Page
- Command Line Version User's Guide
- Exit Codes from 7-Zip
- Command Line Syntax
- -slp (Set Large Pages mode) switch
- Command Line Switches
- -sa (set Archive name mode) switch
- -sfx (Create SFX archive) switch
- -ssc (Set Sensitive Case mode) switch
- -m (Set compression Method) switch
- -bb (Set output log level) switch
- -sdel (Delete files after including to archive) switch
- -an (Disable parsing of archive_name) switch
- -slt (Show technical information) switch
- -o (set Output directory) switch
- -r (Recurse subdirectories) switch
- -i (Include filenames) switch
- -ax (Exclude archive filenames) switch
- -ai (Include archive filenames) switch
- -sns (Store NTFS alternate Streams) switch
- -stl (Set archive timestamp from the most recently modified file) switch
- -spf (Use fully qualified file paths) switch
- -ao (Overwrite mode) switch
- -scs (Set charset for list files) switch
- -so (write data to stdout) switch
- -w (set Working directory) switch
- -ssw (Compress files open for writing) switch
- -u (Update options) switch
- -scrc (Set hash function) switch
- -p (set Password) switch
- -sni (Store NT security information) switch
- -scc (Set charset for console input/output) switch
- -spf (Use fully qualified file paths) switch
- -v (Create Volumes) switch
- -t (set Type of archive) switch
- -- (Stop switches parsing) switch
- -stx (Exclude archive type) switch
- -y (assume Yes on all queries) switch
- -si (read data from stdin) switch
- -x (Exclude filenames) switch
- Command Line Commands
- b (Benchmark) command
- t (Test integrity of archive) command
- x (Extract with full paths) command
- e (Extract) command
- rn (Rename) command
- u (Update) command
- d (Delete) command
- l (List contents of archive) command
- h (Hash) command
- a (Add) command
- General Information
- 7z Format
- Supported formats
- Frequently Asked Questions (FAQ)
- License for use and distribution
- Thanks
- Performance
- 7-Zip File Manager
- About Dialog Box
- Options Dialog Box
- Menu Items and Shortcut Keys
- Benchmark
- Plugins
- 7-Zip Plugin
- Extract Dialog Box
- Add to Archive Dialog Box