Skip to main content

Convert between Linux and Windows path in WSL

Project description

WSL path converter

Convert between Linux and Windows path in WSL (Windows Subsystem for Linux).


Either install the latest stable version hosted on PyPI:

pip install wsl-path-converter

Or clone the source repository and install the bleeding-edge version:

git clone
cd wsl-path-converter
pip install .

If the latter case is run by a regular user, i.e. non-root, the wpc executable will be installed in ~/.local/bin.


This converter works with Windows path mounted in WSL, either through /etc/fstab or through the mount command.

The executable is called wpc. To convert a Windows path to its Linux counterpart, run it with the -u option:

wpc -u C:\autoexec.bat

This is also valid using UNC paths (e.g. remote shares):

wpc -u \\\share

For the converse operation, i.e. convert a Linux path to its Windows counterpart, use the -w option:

wpc -w /mnt/c/autoexec.bat

If a path unambiguously belongs to either Windows or Linux, the conversion option can be skipped; all previous examples can be run without the option:

wpc C:\autoexec.bat
wpc \\\share
wpc /mnt/c/autoexec.bat

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wsl-path-converter-0.3.1.tar.gz (3.7 kB view hashes)

Uploaded source

Built Distributions

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page