How to Run Unrar from Any Directory in Windows CMD

Setting up the unrar command to run globally in the Windows Command Prompt allows you to extract RAR archives from any folder without specifying the full path to the executable. This is accomplished by adding the WinRAR or standalone UnRAR directory to your Windows PATH environment variables. This guide outlines the exact steps to locate your installation, configure your system variables, and verify that the command works properly.

Step 1: Locate the UnRAR Executable

If you have WinRAR installed, the UnRAR.exe utility is already on your computer.

  1. Open File Explorer.
  2. Navigate to your WinRAR installation folder, which is typically: C:\Program Files\WinRAR (For 32-bit versions on a 64-bit system, check C:\Program Files (x86)\WinRAR)
  3. Verify that UnRAR.exe exists in this folder.
  4. Copy the full folder path (C:\Program Files\WinRAR) from the address bar.

Step 2: Open Environment Variables

  1. Press Windows Key + R to open the Run dialog box.
  2. Type sysdm.cpl and press Enter to open System Properties.
  3. Switch to the Advanced tab.
  4. Click the Environment Variables button near the bottom.

Step 3: Add the Path to System Variables

  1. Under the System variables section (or User variables if you only want this accessible for your account), find the variable named Path.
  2. Select Path and click Edit.
  3. In the new window, click New on the right side.
  4. Paste the folder path you copied earlier (e.g., C:\Program Files\WinRAR).
  5. Click OK on all open dialog boxes to save your changes.

Step 4: Verify the Configuration

  1. Press Windows Key + R, type cmd, and press Enter to launch a new Command Prompt window. (Note: You must open a new window for the updated PATH to take effect.)
  2. Type the following command and press Enter:
    unrar
  3. If configured correctly, the terminal will display the UnRAR version information, usage instructions, and available command switches. You can now extract .rar files from any location in Command Prompt using commands like unrar x archive.rar.