27 April 19, 20:57
COMMAND LINE
Below are the common command line syntax in WinRAR.
(a) Archiving files:
Common command line syntax for archiving files.
WinRAR A [ -switches ] <Archive> [ Files ] [ @File lists ]
For example, if user wants to add the file LETTER.TXT to the archive LETTERS.RAR, type:
WinRAR A LETTERS.RAR LETTER.TXT
If an archive extension is not specified, WinRAR will use the default archive format selected in the default compression profile, but user may override it by specifying either .RAR or .ZIP extension.
The next example: add all *.WAV files to the solid RAR archive Songs:
WinRAR A -S Songs.RAR *.WAV
It is also possible to list the files to be archived in a file, rather than listing them in the command line. In this case the name of text file, containing the list of files to be archived, must be given in the command line. This is indicated by placing the symbol @ before this file name. Thus, user can create a file Binaries, containing the strings *.exe and *.com and execute the command:
WinRAR A TOOLS.ZIP @Binaries
to add all files with .EXE and .COM extensions from the current folder to ZIP archive TOOLS.
Command A - add to an archive
Add specified files and folders to an archive. Note: because archive volume modification is disabled, this command cannot be used to update an archive volume, only to create one.
Examples:
(a) add all *.hlp files from the current folder to the archive help.rar
WinRAR a help *.hlp
(b) archive all files from the current folder and subfolders to 362000 bytes size solid, self-extracting volumes save.part1.exe, save.part2.rar, save.part3.rar, …, and add the recovery record to each volume
WinRAR a -r -v362 -s -sfx -rr save
because no file names are specified, all files (*) are assumed.
© as a special exception, if folder name is specified as an argument and if folder name does not include file masks and trailing backslash, the entire contents of the folder and all sub-folders will be added to the archive even if "switch -r" is not specified.
The following command will add all files from the folder Bitmaps and its subfolders to the RAR archive Pictures.rar:
WinRAR a Pictures.rar Bitmaps
if folder name includes file masks or trailing backslash, normal rules apply and you need to specify "switch -r" to process its subfolders.
The following command will add all files from the folder Bitmaps, but not from its subfolders, because "switch -r" is not specified:
WinRAR a Pictures.rar Bitmaps\*
(b) Extract files:
To extract files with full paths:
WinRAR X [ -switches ] <Archive> [ Files ] [ @File lists ] [ Destination folder\ ]
To extract files, ignoring paths:
WinRAR E [ -switches ] <Archive> [ Files ] [ @File lists ] [ Destination folder\ ]
For example if you wish extract the file LETTER.TXT to the current folder from the archive LETTERS.RAR, use the following command:
WinRAR X LETTERS.RAR LETTER.TXT
Archive extension is optional and may be omitted.
The next command extracts all *.WAV files from the archive Songs to the folder Audio:
WinRAR X Songs *.WAV Audio\
It is also possible to list the files to be extracted in a file, rather than listing them in the command line. In this case the name of text file, containing the list of files to be extracted, must be given in the command line. This is indicated by placing the symbol @ before this file name. Thus, user can create a file Binaries, containing the strings *.exe and *.com and execute the command:
WinRAR X TOOLS @Binaries
to extract all files with EXE and COM extensions from the archive TOOLS to the current folder.
Extract archived files, ignoring paths, to the current or a specified folder. Example below is to "extract to the current folder all *.doc files from all RAR archives in the current folder"
WinRAR e *.rar *.doc
Extract files and folder with full paths. The folder structure, saved in the archive, is completely restored. In a similar manner as "command e" this command can extract files both to the current folder and to a specified folder.
WinRAR x Fonts *.ttf
will extract *.ttf files from the archive Fonts to the current folder, but the command:
WinRAR x Fonts *.ttf NewFonts\
will extract *.ttf files from the archive Fonts to the folder NewFonts
User needs to use the "trailing backslash" shown above for denoting the destination folder.
© Command RN - rename archived files
Rename files inside of archive. This command is supported for RAR and ZIP formats. The command syntax is:
winrar rn <arcname> <srcname1> <destname1> … <srcnameN> <destnameN>
For example, the following command:
WinRAR rn data.rar readme.txt readme.bak info.txt info.bak
will rename readme.txt to readme.bak and info.txt to info.bak in the archive data.rar.
It is allowed to use wildcards in the source and destination names for simple name transformations like changing file extensions. For example:
WinRAR rn data.rar *.txt *.bak
will rename all *.txt files to *.bak.
WinRAR does not check if the destination file name is already present in the archive, so you need to be careful to avoid duplicated names. It is especially important when using wildcards. Such command is potentially dangerous, because a wrong wildcard may corrupt all archived names.
(d) Command CH - change archive parameters
This command can be used with most of archive modification switches to modify archive parameters. It is especially convenient for switches like "-cl", "-cu", "-tl", which do not have a dedicated command. It is not able to recompress, encrypt or decrypt archive data and it cannot merge or create volumes. If used without any switches, 'ch' command just copies the archive data without modification.
Example:
set archive time to latest file
WinRAR ch -tl files.rar
(e) Command CV - convert archives
This command provides the command line interface to WinRAR "Convert archives". User can combine it with "-y switch" to skip "Convert archives" dialog and start the operation with default parameters. Use "Save" button in "Convert archives" dialog to change default parameters.
Examples:
convert all ZIP archives in the c:\files folder using default conversion parameters
WinRAR cv -y c:\files\*.zip
(d) Command D - delete files from archive
Delete specified files and folders from an archive. This is the command line equivalent of the "archive management" command "Delete".
Notes:
Example:
delete all *.dmy files from archive dummy.rar
WinRAR d dummy.rar *.dmy
(e) Command S[name] - convert an archive to a self-extracting
This command creates a "self-extracting archive (SFX)" which, when executed, extracts the files contained within it. It is also possible to make an SFX archive as the first of a multi-volume sequence, but it should be noted that the size will be larger by the amount of the SFX module. Should SFX volumes be created using the command "a" with the switches: -v[<size>] -sfx, then you do not need to ensure the volume size - the first volume will be automatically created with the correct size.
This command is the command line equivalent of the "archive management" command "Convert archive to SFX".
Example:
WinRAR s diamant
By default, WinRAR uses for RAR archives SFX module file "default.sfx", which must exist in the same folder as winrar.exe and, for ZIP archives, "zip.sfx" module. It is possible to specify, in the "s" command, an alternate SFX module name.
For example, to add the console SFX module "WinCon.sfx" execute:
WinRAR sWinCon.sfx myinst
(f) Command K - lock an archive
This command prevents any further archive modifications by WinRAR. This is the command line equivalent of the "archive management" command "Lock archive". This command is supported for RAR archive format only.
Example:
WinRAR k release
(g) Command T - test archived files
This command performs a dummy file extraction, writing nothing to the output stream, in order to validate the specified file(s). This is the command line equivalent of the "archive management" command "Test files".
Example:
test all *.rar archives on the current disk
WinRAR t -r \*.rar
SFX archives
An SFX or SelF-eXtracting archive is an archive, merged with an "executable module". Extraction of contents is triggered by executing the SFX archive file. Thus no external program is necessary to extract the contents of an SFX archive, (the SFX archive is enough to execute itself). Nevertheless WinRAR can work with SFX archives as with any other archives, so if the user does not want to run a received SFX archive (for safety purposes), he may use WinRAR to view or extract its contents. All SFX archives usually have ".exe" extension as any other executable file.
To create an SFX archive from the command line or via WinRAR shell either select "Create SFX archive" option in "Archive name and parameters" dialog box when creating a new archive or when using an already existing archive user should press "SFX" toolbar button.
Create an SFX archive from Windows Explorer
The user can create an SFX archive by selecting files inside Windows Explorer. With "Integrate WinRAR into shell" user can just right-click > "Add to archive", set desired parameters (like archive name, destination, password and comments) alongside selecting "Create SFX archive" in "Archiving options" (Archiving options > Create SFX archive --checked). See images below.
To extract the contents of the created SFX archive, the user can just "double-click" said archive to execute "WinRAR self-extracting archive box" or use the right-click function, select "Extract files..."
Both are shown in the images below.
In the WinRAR shell (file management mode) user can create a SFX archive from an existing archive in two ways:
(a) via "Tools > Convert archive to SFX"
Where an "Archive (archive name)?" prompt will appear for the user to select from options, (i) Do not change SFX module, and (ii) Add a new SFX module (pre-selected). Clicking "OK" automatically creates an SFX archive from the existing archive. In this case, the created SFX archive is "QC Tool_Images.exe" from existing archive "QC Tool_Image.rar".
See images below.
(b) via Toolbar button > Add or right-click "Add files to archive..."
Where the "Archive name and parameters" dialog box appears. User needs to select "Archiving options > Create SFX archive" and click "OK". WinRAR will create an SFX archive named "QC Tool_Images.exe" from the existing archive name if user will not enter a "new" name for the SFX archive). The resulting SFX archive (in this case, "QC Tool_Images.exe") will have the existing archive "inside" the SFX archive.
See images below.
In the WinRAR shell (archive management mode) user can create a SFX archive from an existing archive via “Tools > Convert archive to SFX" or via "Toolbar button > SFX". Where an "Archive (archive name)?" prompt will appear for the user to select from options, (i) Do not change SFX module, and (ii) Add a new SFX module. Clicking "OK" automatically creates an SFX archive from the existing archive. In this case, the created SFX archive is "QC Tool_Images.exe" from existing archive "QC Tool_Image.rar". Process is the same as that of creating an SFX archive in "file management mode".
See images below.
If an archive is already self-extracting, using the command "Convert archive to SFX" will give you options to, (i) "Do not change SFX module", (ii) "Add a new SFX module", or (iii) "Remove the already existing module from the archive". If user selects "Remove the already existing module from the archive", WinRAR does not touch the original archive and creates a new archive with the same contents, but without self-extracting module. This is the same in either WinRAR shell state (file management mode or archive management mode).
See images below.
EXTRACTING FILES
Extracting file/s in Windows Explorer
Extracting files in Windows Explorer will be far easier with WinRAR shell integration enabled. Thus it is advisable that the user enable this function via "Options > Settings > Integration > Shell Integration -- (check) "Integrate WinRAR into shell". See image of context menu items connected to extracting files below.
To extract files (contents of an archive in this case "Extrude Taper Faces.rar") to a desired location / destination, user should right-click > select either "Extract files..."(opens the "Extract path and options dialog box where user can set desired destination and additional parameters), "Extract Here" (extract contents in current working folder), or "Extract to Extrude Taper Faces\" (creates a folder "Extrude Taper Faces" and extract's contents inside said folder --without additional parameters set).
For this example the "Extract files..." has been selected. The ""Extract path and options dialog box" opens for the user to set desired destination (in this case "Y:\WinRAR570_Files for Test\EXTRACT HERE\Extract"). See images below of the sample extraction of archive "Extrude Taper Faces.rar"
Extract via Drag and Drop
Extraction of archive contents via "Drag-and drop" is possible by selecting the archive/s and then "press-and-hold" the right mouse button then user drags the selected archive to the desired destination folder. As the user releases the mouse button, a context menu will appear.
For this example the "Extract files..." has been selected. The ""Extract path and options dialog box" opens for the user to set desired destination (in this case "Y:\WinRAR570_Files for Test\EXTRACT HERE\Extrude Taper Faces).
See images below of the sample extraction of archive "Extrude Taper Faces.rar" to new destination "Y:\WinRAR570_Files for Test\EXTRACT HERE\Extrude Taper Faces".
Images below shows "Extract Here" context menu selected. Current working folder is "ARCHIVE HERE" (Y:\WinRAR570_Files for Test\ARCHIVE HERE).
Extract file/s in WinRAR shell mode
Below are common ways to extract files/folders from an archive in WinRAR shell.
To extract a file using WinRAR, user must first open the archive in WinRAR shell via "double-clicking" or press "Enter" on the archive name (in this case "Forum etc.rar") in the Windows Explorer. This will open the archive in WinRAR shell state (archive management mode).
When already in WinRAR shell (file management mode), user can "double-click" or press "Enter" on the archive name to open the archive in "archive management mode".
Any single archive dragged from Windows Explorer and dropped to the WinRAR desktop icon, WinRAR toolbar (or disk list / address bar, file list*) whether it be in either WinRAR shell state (file management mode or archive management mode*) WinRAR opens that "dropped" archive and contents in archive management mode.
Note: If an archive is dropped into the file list of an "open archive" that "dropped archive" will be added to the "open archive" contents (an "Archive name and parameters" prompt will appear). Thus in "archive management mode" drag and drop is limited to the (i) WinRAR desktop icon, (ii) WinRAR toolbar, (iii) disk list / address bar.
When an archive is opened in either WinRAR shell state (file management mode) its contents can be extracted (or if in “archive management mode" contents can be viewed and extracted) via the "Extract To" toolbar button or right-click > (i) Extract to a specified folder, or [/i](ii) Extract without confirmation[/i] context menu.
In either WinRAR shell state (file management mode and archive management mode) the user can extract via (a) Toolbar button > "Extract To" or, (b) via right-click > (select extract context menu).
See images below of "Forum etc.rar" contents extracted to a specified folder (right-click > Extract to a specified folder). Specified folder (destination) is "Y:\WinRAR570_Files for Test\EXTRACT HERE\Extract Forum etc".
Images below shows "Extract without confirmation". Archive contents of "Forum etc.rar" is extracted to "current working folder". Current working folder is "Y:\WinRAR570_Files for Test\ARCHIVE HERE\Archive 2".
If a user wants to stop the extracting process just click the "Cancel" button in the command window. If user wants to "minimize" it and let it run in the background, there is a "Background" button that you can use. There is also options for "Mode" (opens Command parameters), "Pause" and if needed "Help" (opens the built-in Help file). If the extraction is completed without errors, WinRAR will return to the shell, in case of an error, a Diagnostic message window will be displayed.
TEST ARCHIVE FILE
To test an existing archive inside Windows Explorer, the user just needs to right-click on the archive and select the "Test archive" in the context menu. If no errors are detected, WinRAR will display a corresponding message. If there are errors found, WinRAR displays the data via a "Diagnostic message" window.
In WinRAR shell (file management mode) the user can test an existing archive via the main menu Commands > "Test archive files" or the toolbar button > "Test". If no errors are detected, WinRAR will display a corresponding message. If there are errors found, WinRAR displays the data via a "Diagnostic message" window. This is the same as in "archive management mode".
Also in "file management mode" it is possible to select a folder containing one or more archives and WinRAR will search for archives inside that folder for test. User needs to execute the test either via the main menu Commands > "Test archive files" or, the toolbar button > "Test". Upon finishing the search WinRAR will start to test the archives. If an archive is encrypted (password protected) the "Enter password" prompt will appear for the said archive for the test to continue.
VIEW CONTENTS OF AN ARCHIVE
To "view" the files/contents inside an archive you can either use Main menu > Command > View File, or click on the "View" button in the WinRAR window or via keyboard shortcut -- Alt+V.
In the "View file" command, WinRAR shows the contents of the file under the cursor in the "internal viewer" window regardless of the file contents or configuration settings, but if the user were to press "Enter" on a file name, several different results are possible. If the file under the cursor is an archive, WinRAR will open it and display its contents, otherwise further actions depend upon them settings specified in "Viewer settings dialog box".
Through this dialog box ( Options > Settings > Viewer ) the user may force WinRAR to always use the internal viewer, (i) to open the file in the external viewer, (ii) to call a program associated by Windows with this file type or, (iv) to ask, each time before viewing the file.
WinRAR can be used to view normal files (whether in an archive or not). If an "external program" is called to view a file, WinRAR unpacks this file to a "temporary folder", passes its name to the external program and waits for the program to terminate. After this WinRAR tests the file modification time and if it was updated, offers to update this file in the archive and then deletes the temporary folder with the extracted file. In this case the WinRAR temporary folder is "C:\Users\JB_W101709\AppData\Local\Temp". This can be set in "Options > Settings > Paths > Folder for temporary files". (Note that the user can specify a different folder according to his preference).
The scheme described above is slightly modified, when "Enter" is pressed on a content (of an archived file), which has ".exe" extension (SFX archive). In this case WinRAR extracts not only this file, but the "complete contents" of the archive to the "temporary folder" and then runs the executable file. Take the case below. The SFX archive "Chrysler_PFMEA Audit checklist.exe" is opened in WinRAR shell (archive management mode) displaying the lone content "Chrysler_PFMEA Audit checklist.pdf". Pressing "Enter" on "Chrysler_PFMEA Audit checklist.pdf" runs the file (inside the temporary folder). Now "Chrysler_PFMEA Audit checklist.exe" (SFX archive) is encrypted thus when content is opened it the "Enter password" prompt appears.
See images below.
DELETING CONTENTS OF AN ARCHIVE
The "Delete" command in WinRAR shell state is accessible in both "file management mode" and "archive management mode" but the user should be wary of the differences between deleting in both states.
Delete in File Management Mode
In WinRAR shell "file management mode" anything that is deleted (selected files and folders, etc) goes to the Recycle Bin. This is like the user is in "Windows Explorer". So user has the chance to restore accidentally deleted data. The "Delete" command can be executed by either the (i) "toolbar button > Delete", (ii) "right-click > Delete files" or, (iii) " Commands > Delete files".
(Note: If user has enabled "Display delete confirmation dialog" in Recycle Bin > Properties, a confirmation prompt of the executed delete action will be seen prior deletion).
See images below.
File management mode also allows the user to delete files permanently (tailored for advanced users). This can be done by using the keyboard, pressing "Shift+Delete" instead of "Delete" key or the toolbar button > "Delete" (or "Commands > Delete files”).
Delete in Archive Management Mode
In WinRAR shell "archive management mode" all deleted files/folders are completely/permanently deleted from the archive without any possibility of restoring them. User should "remember" that he is inside an open archive. The archive IS NOT connected to Windows Explorer shell thus deleting anything "inside" the archive is permanently deleted. The "Delete" command can be executed by either the (i) "toolbar button > Delete", (ii) "right-click > Delete files" or, (iii) " Commands > Delete files".
FIND FILES
The "Find" command in WinRAR shell is accessible in both states (file management mode and archive management mode). User can execute "Find files" via the toolbar button > "Find", or "Tools > Find files".
Using "Find files" dialog it is possible to search for files contained the specified string either in the opened archive or in selected folders or disks. Dialog items are described below.
File name to find
By default it contains "*", what means to check all files. You may enter other file mask here, for example, "*.txt" to search only in .txt files. It is allowed to enter several file masks separated by spaces. If you need to specify a file name containing spaces, enclose it in quotes.
String to find
Here you may enter a string to find. If you leave this field blank, WinRAR will display all files matching other specified criteria.
Match case
Enables case sensitive string comparison.
Use all tables
Use ANSI, Unicode and OEM (MS DOS) character tables when searching for string. If this option is off, WinRAR uses only the default Windows character table (ANSI) in the search operation.
Hexadecimal search
Treat the entered string as sequence of hexadecimal values separated by spaces.
Search area
This option is restricted to currently opened archive if searching inside of archive. Outside of archive use "Current folder" to search in the current folder only, "Selected items" to search in folders and files selected in WinRAR file list. Select appropriate drive names to search on these drives.
Archive types
Archive types to search in. By default it contains "*", what means "all archive formats", but, for example, you may enter "*.rar" to search data only in rar archives. It is allowed to enter several archive masks separated by spaces. Because of technical limitations WinRAR is not able to search for text in ACE archives, other formats supported by WinRAR are supported here.
"Find in subfolders" option
Forces WinRAR to search not only in the specified folder, but also in its subfolders.
"Find in files" option
If enabled, WinRAR will search in usual not archived files matching the specified file name.
"Find in archives" option
Enables to search in the archived files. You may set both "Find in files" and "Find in archives" to search a desired string both in archives and in usual files.
"Skip encrypted" option
If password is required to search inside of encrypted archive, such archive is skipped silently.
"Save" button
This button saves the current state of dialog, so it will be automatically restored when activated next time.
See images below.
Below are the common command line syntax in WinRAR.
(a) Archiving files:
Common command line syntax for archiving files.
WinRAR A [ -switches ] <Archive> [ Files ] [ @File lists ]
For example, if user wants to add the file LETTER.TXT to the archive LETTERS.RAR, type:
WinRAR A LETTERS.RAR LETTER.TXT
If an archive extension is not specified, WinRAR will use the default archive format selected in the default compression profile, but user may override it by specifying either .RAR or .ZIP extension.
The next example: add all *.WAV files to the solid RAR archive Songs:
WinRAR A -S Songs.RAR *.WAV
It is also possible to list the files to be archived in a file, rather than listing them in the command line. In this case the name of text file, containing the list of files to be archived, must be given in the command line. This is indicated by placing the symbol @ before this file name. Thus, user can create a file Binaries, containing the strings *.exe and *.com and execute the command:
WinRAR A TOOLS.ZIP @Binaries
to add all files with .EXE and .COM extensions from the current folder to ZIP archive TOOLS.
Command A - add to an archive
Add specified files and folders to an archive. Note: because archive volume modification is disabled, this command cannot be used to update an archive volume, only to create one.
Examples:
(a) add all *.hlp files from the current folder to the archive help.rar
WinRAR a help *.hlp
(b) archive all files from the current folder and subfolders to 362000 bytes size solid, self-extracting volumes save.part1.exe, save.part2.rar, save.part3.rar, …, and add the recovery record to each volume
WinRAR a -r -v362 -s -sfx -rr save
because no file names are specified, all files (*) are assumed.
© as a special exception, if folder name is specified as an argument and if folder name does not include file masks and trailing backslash, the entire contents of the folder and all sub-folders will be added to the archive even if "switch -r" is not specified.
The following command will add all files from the folder Bitmaps and its subfolders to the RAR archive Pictures.rar:
WinRAR a Pictures.rar Bitmaps
if folder name includes file masks or trailing backslash, normal rules apply and you need to specify "switch -r" to process its subfolders.
The following command will add all files from the folder Bitmaps, but not from its subfolders, because "switch -r" is not specified:
WinRAR a Pictures.rar Bitmaps\*
(b) Extract files:
To extract files with full paths:
WinRAR X [ -switches ] <Archive> [ Files ] [ @File lists ] [ Destination folder\ ]
To extract files, ignoring paths:
WinRAR E [ -switches ] <Archive> [ Files ] [ @File lists ] [ Destination folder\ ]
For example if you wish extract the file LETTER.TXT to the current folder from the archive LETTERS.RAR, use the following command:
WinRAR X LETTERS.RAR LETTER.TXT
Archive extension is optional and may be omitted.
The next command extracts all *.WAV files from the archive Songs to the folder Audio:
WinRAR X Songs *.WAV Audio\
It is also possible to list the files to be extracted in a file, rather than listing them in the command line. In this case the name of text file, containing the list of files to be extracted, must be given in the command line. This is indicated by placing the symbol @ before this file name. Thus, user can create a file Binaries, containing the strings *.exe and *.com and execute the command:
WinRAR X TOOLS @Binaries
to extract all files with EXE and COM extensions from the archive TOOLS to the current folder.
Extract archived files, ignoring paths, to the current or a specified folder. Example below is to "extract to the current folder all *.doc files from all RAR archives in the current folder"
WinRAR e *.rar *.doc
Extract files and folder with full paths. The folder structure, saved in the archive, is completely restored. In a similar manner as "command e" this command can extract files both to the current folder and to a specified folder.
WinRAR x Fonts *.ttf
will extract *.ttf files from the archive Fonts to the current folder, but the command:
WinRAR x Fonts *.ttf NewFonts\
will extract *.ttf files from the archive Fonts to the folder NewFonts
User needs to use the "trailing backslash" shown above for denoting the destination folder.
© Command RN - rename archived files
Rename files inside of archive. This command is supported for RAR and ZIP formats. The command syntax is:
winrar rn <arcname> <srcname1> <destname1> … <srcnameN> <destnameN>
For example, the following command:
WinRAR rn data.rar readme.txt readme.bak info.txt info.bak
will rename readme.txt to readme.bak and info.txt to info.bak in the archive data.rar.
It is allowed to use wildcards in the source and destination names for simple name transformations like changing file extensions. For example:
WinRAR rn data.rar *.txt *.bak
will rename all *.txt files to *.bak.
WinRAR does not check if the destination file name is already present in the archive, so you need to be careful to avoid duplicated names. It is especially important when using wildcards. Such command is potentially dangerous, because a wrong wildcard may corrupt all archived names.
(d) Command CH - change archive parameters
This command can be used with most of archive modification switches to modify archive parameters. It is especially convenient for switches like "-cl", "-cu", "-tl", which do not have a dedicated command. It is not able to recompress, encrypt or decrypt archive data and it cannot merge or create volumes. If used without any switches, 'ch' command just copies the archive data without modification.
Example:
set archive time to latest file
WinRAR ch -tl files.rar
(e) Command CV - convert archives
This command provides the command line interface to WinRAR "Convert archives". User can combine it with "-y switch" to skip "Convert archives" dialog and start the operation with default parameters. Use "Save" button in "Convert archives" dialog to change default parameters.
Examples:
convert all ZIP archives in the c:\files folder using default conversion parameters
WinRAR cv -y c:\files\*.zip
(d) Command D - delete files from archive
Delete specified files and folders from an archive. This is the command line equivalent of the "archive management" command "Delete".
Notes:
- (a) If this command removes all files from archive, the empty archive is removed.
- © This command is not applicable to volumes, because volumes cannot be modified.
Example:
delete all *.dmy files from archive dummy.rar
WinRAR d dummy.rar *.dmy
(e) Command S[name] - convert an archive to a self-extracting
This command creates a "self-extracting archive (SFX)" which, when executed, extracts the files contained within it. It is also possible to make an SFX archive as the first of a multi-volume sequence, but it should be noted that the size will be larger by the amount of the SFX module. Should SFX volumes be created using the command "a" with the switches: -v[<size>] -sfx, then you do not need to ensure the volume size - the first volume will be automatically created with the correct size.
This command is the command line equivalent of the "archive management" command "Convert archive to SFX".
Example:
WinRAR s diamant
By default, WinRAR uses for RAR archives SFX module file "default.sfx", which must exist in the same folder as winrar.exe and, for ZIP archives, "zip.sfx" module. It is possible to specify, in the "s" command, an alternate SFX module name.
For example, to add the console SFX module "WinCon.sfx" execute:
WinRAR sWinCon.sfx myinst
(f) Command K - lock an archive
This command prevents any further archive modifications by WinRAR. This is the command line equivalent of the "archive management" command "Lock archive". This command is supported for RAR archive format only.
Example:
WinRAR k release
(g) Command T - test archived files
This command performs a dummy file extraction, writing nothing to the output stream, in order to validate the specified file(s). This is the command line equivalent of the "archive management" command "Test files".
Example:
test all *.rar archives on the current disk
WinRAR t -r \*.rar
SFX archives
An SFX or SelF-eXtracting archive is an archive, merged with an "executable module". Extraction of contents is triggered by executing the SFX archive file. Thus no external program is necessary to extract the contents of an SFX archive, (the SFX archive is enough to execute itself). Nevertheless WinRAR can work with SFX archives as with any other archives, so if the user does not want to run a received SFX archive (for safety purposes), he may use WinRAR to view or extract its contents. All SFX archives usually have ".exe" extension as any other executable file.
To create an SFX archive from the command line or via WinRAR shell either select "Create SFX archive" option in "Archive name and parameters" dialog box when creating a new archive or when using an already existing archive user should press "SFX" toolbar button.
Create an SFX archive from Windows Explorer
The user can create an SFX archive by selecting files inside Windows Explorer. With "Integrate WinRAR into shell" user can just right-click > "Add to archive", set desired parameters (like archive name, destination, password and comments) alongside selecting "Create SFX archive" in "Archiving options" (Archiving options > Create SFX archive --checked). See images below.
To extract the contents of the created SFX archive, the user can just "double-click" said archive to execute "WinRAR self-extracting archive box" or use the right-click function, select "Extract files..."
Both are shown in the images below.
In the WinRAR shell (file management mode) user can create a SFX archive from an existing archive in two ways:
(a) via "Tools > Convert archive to SFX"
Where an "Archive (archive name)?" prompt will appear for the user to select from options, (i) Do not change SFX module, and (ii) Add a new SFX module (pre-selected). Clicking "OK" automatically creates an SFX archive from the existing archive. In this case, the created SFX archive is "QC Tool_Images.exe" from existing archive "QC Tool_Image.rar".
See images below.
(b) via Toolbar button > Add or right-click "Add files to archive..."
Where the "Archive name and parameters" dialog box appears. User needs to select "Archiving options > Create SFX archive" and click "OK". WinRAR will create an SFX archive named "QC Tool_Images.exe" from the existing archive name if user will not enter a "new" name for the SFX archive). The resulting SFX archive (in this case, "QC Tool_Images.exe") will have the existing archive "inside" the SFX archive.
See images below.
In the WinRAR shell (archive management mode) user can create a SFX archive from an existing archive via “Tools > Convert archive to SFX" or via "Toolbar button > SFX". Where an "Archive (archive name)?" prompt will appear for the user to select from options, (i) Do not change SFX module, and (ii) Add a new SFX module. Clicking "OK" automatically creates an SFX archive from the existing archive. In this case, the created SFX archive is "QC Tool_Images.exe" from existing archive "QC Tool_Image.rar". Process is the same as that of creating an SFX archive in "file management mode".
See images below.
If an archive is already self-extracting, using the command "Convert archive to SFX" will give you options to, (i) "Do not change SFX module", (ii) "Add a new SFX module", or (iii) "Remove the already existing module from the archive". If user selects "Remove the already existing module from the archive", WinRAR does not touch the original archive and creates a new archive with the same contents, but without self-extracting module. This is the same in either WinRAR shell state (file management mode or archive management mode).
See images below.
EXTRACTING FILES
Extracting file/s in Windows Explorer
Extracting files in Windows Explorer will be far easier with WinRAR shell integration enabled. Thus it is advisable that the user enable this function via "Options > Settings > Integration > Shell Integration -- (check) "Integrate WinRAR into shell". See image of context menu items connected to extracting files below.
To extract files (contents of an archive in this case "Extrude Taper Faces.rar") to a desired location / destination, user should right-click > select either "Extract files..."(opens the "Extract path and options dialog box where user can set desired destination and additional parameters), "Extract Here" (extract contents in current working folder), or "Extract to Extrude Taper Faces\" (creates a folder "Extrude Taper Faces" and extract's contents inside said folder --without additional parameters set).
For this example the "Extract files..." has been selected. The ""Extract path and options dialog box" opens for the user to set desired destination (in this case "Y:\WinRAR570_Files for Test\EXTRACT HERE\Extract"). See images below of the sample extraction of archive "Extrude Taper Faces.rar"
Extract via Drag and Drop
Extraction of archive contents via "Drag-and drop" is possible by selecting the archive/s and then "press-and-hold" the right mouse button then user drags the selected archive to the desired destination folder. As the user releases the mouse button, a context menu will appear.
For this example the "Extract files..." has been selected. The ""Extract path and options dialog box" opens for the user to set desired destination (in this case "Y:\WinRAR570_Files for Test\EXTRACT HERE\Extrude Taper Faces).
See images below of the sample extraction of archive "Extrude Taper Faces.rar" to new destination "Y:\WinRAR570_Files for Test\EXTRACT HERE\Extrude Taper Faces".
Images below shows "Extract Here" context menu selected. Current working folder is "ARCHIVE HERE" (Y:\WinRAR570_Files for Test\ARCHIVE HERE).
Extract file/s in WinRAR shell mode
Below are common ways to extract files/folders from an archive in WinRAR shell.
To extract a file using WinRAR, user must first open the archive in WinRAR shell via "double-clicking" or press "Enter" on the archive name (in this case "Forum etc.rar") in the Windows Explorer. This will open the archive in WinRAR shell state (archive management mode).
When already in WinRAR shell (file management mode), user can "double-click" or press "Enter" on the archive name to open the archive in "archive management mode".
Any single archive dragged from Windows Explorer and dropped to the WinRAR desktop icon, WinRAR toolbar (or disk list / address bar, file list*) whether it be in either WinRAR shell state (file management mode or archive management mode*) WinRAR opens that "dropped" archive and contents in archive management mode.
Note: If an archive is dropped into the file list of an "open archive" that "dropped archive" will be added to the "open archive" contents (an "Archive name and parameters" prompt will appear). Thus in "archive management mode" drag and drop is limited to the (i) WinRAR desktop icon, (ii) WinRAR toolbar, (iii) disk list / address bar.
When an archive is opened in either WinRAR shell state (file management mode) its contents can be extracted (or if in “archive management mode" contents can be viewed and extracted) via the "Extract To" toolbar button or right-click > (i) Extract to a specified folder, or [/i](ii) Extract without confirmation[/i] context menu.
In either WinRAR shell state (file management mode and archive management mode) the user can extract via (a) Toolbar button > "Extract To" or, (b) via right-click > (select extract context menu).
See images below of "Forum etc.rar" contents extracted to a specified folder (right-click > Extract to a specified folder). Specified folder (destination) is "Y:\WinRAR570_Files for Test\EXTRACT HERE\Extract Forum etc".
Images below shows "Extract without confirmation". Archive contents of "Forum etc.rar" is extracted to "current working folder". Current working folder is "Y:\WinRAR570_Files for Test\ARCHIVE HERE\Archive 2".
If a user wants to stop the extracting process just click the "Cancel" button in the command window. If user wants to "minimize" it and let it run in the background, there is a "Background" button that you can use. There is also options for "Mode" (opens Command parameters), "Pause" and if needed "Help" (opens the built-in Help file). If the extraction is completed without errors, WinRAR will return to the shell, in case of an error, a Diagnostic message window will be displayed.
TEST ARCHIVE FILE
To test an existing archive inside Windows Explorer, the user just needs to right-click on the archive and select the "Test archive" in the context menu. If no errors are detected, WinRAR will display a corresponding message. If there are errors found, WinRAR displays the data via a "Diagnostic message" window.
In WinRAR shell (file management mode) the user can test an existing archive via the main menu Commands > "Test archive files" or the toolbar button > "Test". If no errors are detected, WinRAR will display a corresponding message. If there are errors found, WinRAR displays the data via a "Diagnostic message" window. This is the same as in "archive management mode".
Also in "file management mode" it is possible to select a folder containing one or more archives and WinRAR will search for archives inside that folder for test. User needs to execute the test either via the main menu Commands > "Test archive files" or, the toolbar button > "Test". Upon finishing the search WinRAR will start to test the archives. If an archive is encrypted (password protected) the "Enter password" prompt will appear for the said archive for the test to continue.
VIEW CONTENTS OF AN ARCHIVE
To "view" the files/contents inside an archive you can either use Main menu > Command > View File, or click on the "View" button in the WinRAR window or via keyboard shortcut -- Alt+V.
In the "View file" command, WinRAR shows the contents of the file under the cursor in the "internal viewer" window regardless of the file contents or configuration settings, but if the user were to press "Enter" on a file name, several different results are possible. If the file under the cursor is an archive, WinRAR will open it and display its contents, otherwise further actions depend upon them settings specified in "Viewer settings dialog box".
Through this dialog box ( Options > Settings > Viewer ) the user may force WinRAR to always use the internal viewer, (i) to open the file in the external viewer, (ii) to call a program associated by Windows with this file type or, (iv) to ask, each time before viewing the file.
WinRAR can be used to view normal files (whether in an archive or not). If an "external program" is called to view a file, WinRAR unpacks this file to a "temporary folder", passes its name to the external program and waits for the program to terminate. After this WinRAR tests the file modification time and if it was updated, offers to update this file in the archive and then deletes the temporary folder with the extracted file. In this case the WinRAR temporary folder is "C:\Users\JB_W101709\AppData\Local\Temp". This can be set in "Options > Settings > Paths > Folder for temporary files". (Note that the user can specify a different folder according to his preference).
The scheme described above is slightly modified, when "Enter" is pressed on a content (of an archived file), which has ".exe" extension (SFX archive). In this case WinRAR extracts not only this file, but the "complete contents" of the archive to the "temporary folder" and then runs the executable file. Take the case below. The SFX archive "Chrysler_PFMEA Audit checklist.exe" is opened in WinRAR shell (archive management mode) displaying the lone content "Chrysler_PFMEA Audit checklist.pdf". Pressing "Enter" on "Chrysler_PFMEA Audit checklist.pdf" runs the file (inside the temporary folder). Now "Chrysler_PFMEA Audit checklist.exe" (SFX archive) is encrypted thus when content is opened it the "Enter password" prompt appears.
See images below.
DELETING CONTENTS OF AN ARCHIVE
The "Delete" command in WinRAR shell state is accessible in both "file management mode" and "archive management mode" but the user should be wary of the differences between deleting in both states.
Delete in File Management Mode
In WinRAR shell "file management mode" anything that is deleted (selected files and folders, etc) goes to the Recycle Bin. This is like the user is in "Windows Explorer". So user has the chance to restore accidentally deleted data. The "Delete" command can be executed by either the (i) "toolbar button > Delete", (ii) "right-click > Delete files" or, (iii) " Commands > Delete files".
(Note: If user has enabled "Display delete confirmation dialog" in Recycle Bin > Properties, a confirmation prompt of the executed delete action will be seen prior deletion).
See images below.
File management mode also allows the user to delete files permanently (tailored for advanced users). This can be done by using the keyboard, pressing "Shift+Delete" instead of "Delete" key or the toolbar button > "Delete" (or "Commands > Delete files”).
Delete in Archive Management Mode
In WinRAR shell "archive management mode" all deleted files/folders are completely/permanently deleted from the archive without any possibility of restoring them. User should "remember" that he is inside an open archive. The archive IS NOT connected to Windows Explorer shell thus deleting anything "inside" the archive is permanently deleted. The "Delete" command can be executed by either the (i) "toolbar button > Delete", (ii) "right-click > Delete files" or, (iii) " Commands > Delete files".
FIND FILES
The "Find" command in WinRAR shell is accessible in both states (file management mode and archive management mode). User can execute "Find files" via the toolbar button > "Find", or "Tools > Find files".
Using "Find files" dialog it is possible to search for files contained the specified string either in the opened archive or in selected folders or disks. Dialog items are described below.
File name to find
By default it contains "*", what means to check all files. You may enter other file mask here, for example, "*.txt" to search only in .txt files. It is allowed to enter several file masks separated by spaces. If you need to specify a file name containing spaces, enclose it in quotes.
String to find
Here you may enter a string to find. If you leave this field blank, WinRAR will display all files matching other specified criteria.
Match case
Enables case sensitive string comparison.
Use all tables
Use ANSI, Unicode and OEM (MS DOS) character tables when searching for string. If this option is off, WinRAR uses only the default Windows character table (ANSI) in the search operation.
Hexadecimal search
Treat the entered string as sequence of hexadecimal values separated by spaces.
Search area
This option is restricted to currently opened archive if searching inside of archive. Outside of archive use "Current folder" to search in the current folder only, "Selected items" to search in folders and files selected in WinRAR file list. Select appropriate drive names to search on these drives.
Archive types
Archive types to search in. By default it contains "*", what means "all archive formats", but, for example, you may enter "*.rar" to search data only in rar archives. It is allowed to enter several archive masks separated by spaces. Because of technical limitations WinRAR is not able to search for text in ACE archives, other formats supported by WinRAR are supported here.
"Find in subfolders" option
Forces WinRAR to search not only in the specified folder, but also in its subfolders.
"Find in files" option
If enabled, WinRAR will search in usual not archived files matching the specified file name.
"Find in archives" option
Enables to search in the archived files. You may set both "Find in files" and "Find in archives" to search a desired string both in archives and in usual files.
"Skip encrypted" option
If password is required to search inside of encrypted archive, such archive is skipped silently.
"Save" button
This button saves the current state of dialog, so it will be automatically restored when activated next time.
See images below.