RAR.exe (version 7.01 x64) won't start with the error "ERROR: '-' is expected in the beginning of: C:\Program Files\WinRAR\RAR.exe" from Command Prompt #22009

Closed
opened 2026-01-31 08:00:47 +00:00 by claunia · 5 comments
Owner

Originally created by @gschizas on GitHub (Jul 25, 2024).

Windows Terminal version

1.21.1772.0

Windows build number

10.0.22631.3880

Other Software

rar.exe version 7.01 x64 (from win-rar.com

Steps to reproduce

  1. Download WinRAR from https://www.win-rar.com/.
  2. Open Command Prompt
  3. Run "C:\Program Files\WinRAR\Rar.exe" (or cd "C:\Program Files\WinRAR" and then run Rar.exe)

Expected Behavior

Expected to see the help text (command line switches) for RAR.exe

Actual Behavior

I'm getting "ERROR: '-' is expected in the beginning of: C:\Program Files\WinRAR\RAR.exe"

Originally created by @gschizas on GitHub (Jul 25, 2024). ### Windows Terminal version 1.21.1772.0 ### Windows build number 10.0.22631.3880 ### Other Software rar.exe version 7.01 x64 (from [win-rar.com](https://www.win-rar.com/) ### Steps to reproduce 1. Download WinRAR from https://www.win-rar.com/. 2. Open Command Prompt 3. Run `"C:\Program Files\WinRAR\Rar.exe"` (or `cd "C:\Program Files\WinRAR"` and then run `Rar.exe`) ### Expected Behavior Expected to see the help text (command line switches) for RAR.exe ### Actual Behavior I'm getting "ERROR: '-' is expected in the beginning of: C:\Program Files\WinRAR\RAR.exe"
claunia added the Needs-TriageIssue-Bug labels 2026-01-31 08:00:47 +00:00
Author
Owner

@gschizas commented on GitHub (Jul 25, 2024):

These combinations work:

  • Windows Terminal 1.20.11781.0 with any shell (Command Prompt (cmd.exe), Windows PowerShell (5), PowerShell (7))
  • Windows Terminal 1.21.1772.0 with any PowerShell (5 or 7)
  • Console Host with any shell (cmd.exe or PowerShell 5/7)

It's only the combination of Windows Terminal Preview (1.21.1772.0) with Command Prompt that doesn't work.

@gschizas commented on GitHub (Jul 25, 2024): These combinations work: * Windows Terminal 1.20.11781.0 with any shell (Command Prompt (cmd.exe), Windows PowerShell (5), PowerShell (7)) * Windows Terminal 1.21.1772.0 with any PowerShell (5 or 7) * Console Host with any shell (cmd.exe or PowerShell 5/7) It's only the combination of Windows Terminal Preview (1.21.1772.0) with Command Prompt that doesn't work.
Author
Owner

@gschizas commented on GitHub (Jul 25, 2024):

After all, the problem was with an environment variable. No problem at all with either Windows Terminal or RAR.exe (technically, the problem is with RAR.exe, but it was being abused).

Apparently the environment variable RAR has some special usage from RAR.exe

@gschizas commented on GitHub (Jul 25, 2024): After all, the problem was with an environment variable. No problem at all with either Windows Terminal or RAR.exe (technically, the problem is with RAR.exe, but it was being abused). Apparently the environment variable RAR has some special usage from RAR.exe
Author
Owner

@DHowett commented on GitHub (Jul 25, 2024):

Wow, that’s a weird one! Thanks for following up!

@DHowett commented on GitHub (Jul 25, 2024): Wow, that’s a weird one! Thanks for following up!
Author
Owner

@strawberryfield commented on GitHub (Sep 10, 2024):

I don't understand as you solved the problem.

@strawberryfield commented on GitHub (Sep 10, 2024): I don't understand as you solved the problem.
Author
Owner

@gschizas commented on GitHub (Sep 10, 2024):

I don't understand as you solved the problem.

It wasn't a problem with Windows Terminal, it was a problem with RAR.exe. If you set an environment variable RAR (e.g. SET RAR=abcd), the latest version of the RAR.exe command line uses it as the default options.

@gschizas commented on GitHub (Sep 10, 2024): > I don't understand as you solved the problem. It wasn't a problem with Windows Terminal, it was a problem with RAR.exe. If you set an environment variable RAR (e.g. `SET RAR=abcd`), the latest version of the RAR.exe command line uses it as the default options.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22009