- 1 year ago
Unrar all files from a folder using Windows terminal
Comment
1 / 1
To unrar all files from a folder using the Windows terminal, you need to have the unrar
command-line tool installed on your system. If you don't have it, you can download and install it from the official website (https://www.rarlab.com/rar_add.htm).
Once unrar
is installed, you can use the following batch script to unrar all files from a folder:
batch@echo off
set "rar_exe=C:\path\to\unrar.exe" <-- Replace with the path to unrar.exe
set "source_folder=C:\path\to\source_folder" <-- Replace with the path to the source folder
cd /d "%source_folder%"
for %%F in (*.rar) do (
"%rar_exe%" x "%%F"
)
echo All files have been unrarred.
pause
In the script:
- Set the
rar_exe
variable to the path of theunrar.exe
file. - Set the
source_folder
variable to the path of the folder containing the.rar
files you want to unrar.
The script changes to the specified source folder using cd /d
, and then it loops through all .rar
files in the folder using a for
loop. For each .rar
file found, it runs the unrar
command with the x
option to extract the contents of the file.
Save the batch script with a .bat
extension, and double-click it to execute the commands and unrar all files from the specified folder.