Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Copy As WSLNew to Visual Studio Code? Get it now.
Copy As WSL

Copy As WSL

Junior Mayhé

|
97 installs
| (0) | Free
Copies to clipboard a Windows path as a WSL path.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy As WSL

A Visual Studio Code extension that simplifies working with Windows Subsystem for Linux (WSL) by providing quick actions to copy file and folder paths in the WSL format directly to your clipboard.

Features

This extension adds two convenient commands to your VS Code Explorer and Editor Tab context menus (right-click menus):

Copy as WSL

  • If a file is selected: Copies the full Windows file path converted to its WSL equivalent (e.g., C:\path\to\file.txt becomes /mnt/c/path/to/file.txt).
  • If a folder is selected: Copies the full Windows folder path converted to its WSL equivalent (e.g., C:\path\to\myfolder\ becomes /mnt/c/path/to/myfolder/).

Copy folder as WSL

  • If a file is selected: Extracts the containing folder's path and copies its WSL equivalent (e.g., C:\path\to\file.txt becomes /mnt/c/path/to/).
  • If a folder is selected: Copies the full Windows folder path converted to its WSL equivalent (e.g., C:\path\to\myfolder\ becomes /mnt/c/path/to/myfolder/).

These commands are only visible when VS Code is running in a Windows OS environment.

Installation

From the Visual Studio Code Marketplace (Recommended)

Once published to the Marketplace:

  1. Open Visual Studio Code.
  2. Go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X).
  3. Search for Copy As WSL.
  4. Click Install.

Manual Installation (.vsix file)

If you have the .vsix file (generated by vsce package):

  1. Open Visual Studio Code.
  2. Go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X).
  3. Click on the ... (More Actions) menu in the top-right of the Extensions view.
  4. Select Install from VSIX....
  5. Browse to and select the copy-as-wsl-X.Y.Z.vsix file.

Usage

Ensure you are running VS Code on a Windows operating system.

In the Explorer View

  • Right-click on any file or folder.
  • You will see a section with Copy as WSL and Copy folder as WSL options.

On an Editor Tab

  • Right-click on the tab of an open file.
  • You will see the Copy as WSL and Copy folder as WSL options.

Click the desired option, and the corresponding WSL path will be copied to your clipboard. A notification will confirm the action.

Requirements

  • Visual Studio Code (version ^1.101.0 or higher).
  • Windows Operating System (with WSL installed if you plan to use the copied paths in WSL environments).

Author: Junior Mayhé

Feel free to contribute, report issues, or suggest improvements on the GitHub Repository.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft