-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.
Syntax
-w[{dir_path}]
- {dir_path}
-
Specifies the destination directory path. It's not required that a path end with a backslash.
If <dir_path> is not assigned, then 7-Zip will use the Windows temporary directory.
Example
7z a -tzip archive.zip *.cpp -wc:\temp
adds *.cpp files to the archive.zip archive, creating a temporary archive in c:\temp folder.
Commands that can be used with this switch
a (Add), d (Delete), rn (Rename), u (Update),
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