Extract a .rar file using a batch file

batch-file

Solution

Check this page: https://cects.com/using-the-winrar-command-line-tools-in-windows/

Basically (taken from that site):

`rar a -r yourfiles.rar *.txt c:\yourfolder` to compress something

`unrar x c:\yourfile.rar *.gif c:\extractfolder\` to uncompress something

The *.txt and *.gif are used for filtering file types and can be omitted.

At the bottom of the page are also links to two example batch files.

Problem

I am trying to create a batch file which extracts a .rar file using WinRAR to C:\Program Files\ Please help I tried the following code ``` set rar=%ProgramFiles%\WinRAR\RAR.exe set unrar=%programFiles%\WinRAR\UnRAR.exe ``` and then you compress like this: ``` "%rar%" a "drop location" "target location" ``` or decompress like this: ``` %unrar% e "target location" ``` but I don't seem to see an option here which shows where the target rar file is. Please help me.

Original source