Skip to content

Instantly share code, notes, and snippets.

View TaipanRex's full-sized avatar

Christian Reksten-Monsen TaipanRex

View GitHub Profile
@TaipanRex
TaipanRex / Windows-app-Ranger.md
Last active November 16, 2023 10:05
How to launch Windows applications from Ranger in Windows Subsystem for Linux (WSL)

Make sure you have WSL with the Windows 10 Fall Creators Update installed. Ranger uses rifle as a file handler and you need its config file, rifle.conf. If you dont have it (should be in ~/.config/ranger/rifle.conf), run the command ranger --copy-config=rifle, then edit the resulting file.

To run Windows applications from Ranger, we will use cmd.exe /C start "" <file>, which works after the Fall Creators Update. The problem is that Ranger will feed in file paths using Unix pathing, but start expects Windows pathing. We will solve this by using sed to translate the path.

Add below code to your rifle.conf and you will be able to run Windows applications for the chosen file extensions.