Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Copy File Name (Faster)New to Visual Studio Code? Get it now.
Copy File Name (Faster)

Copy File Name (Faster)

Pawan

|
13 installs
| (0) | Free
Copy just a file or folder name from the VS Code Explorer or editor-tab menu, including compatible browser-hosted VS Code IDEs.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy File Name (Faster)

Copy only a file or folder name from a VS Code context menu. No parent path, dialog, or notification is added.

Use It

Right-click a file or folder in the Explorer, or an open editor tab, and choose Copy File Name to omit a file extension or Copy File Name with Extension to include it. Paste the result wherever you need it.

VS Code web IDE with a folder selected in the Explorer

VS Code web IDE with a file open in an editor tab

How It Works

VS Code passes the selected resource URI to the command. The extension takes the final path segment and writes it using VS Code's vscode.env.clipboard.writeText() API. The extension-free option removes the final suffix after a dot, except for dotfiles such as .env. It does not read or send file contents.

Browser IDEs

The extension requires VS Code 1.89.1 or later and is bundled for both the Node.js and web extension hosts. In remote workspaces, it prefers the workspace extension host and can fall back to the web extension host. It uses VS Code's clipboard API rather than direct browser clipboard access.

In an IDE such as Agentforce, clipboard writes still depend on the host exposing the required VS Code API and the browser allowing clipboard access. The host's extension and clipboard policies apply. This dual-host package supports both workspace and browser extension hosts when the host restores extensions after a session restart.

Compared With Other Options

Option Clipboard result
Copy File Name The selected name without its final file extension
Copy File Name with Extension The selected name including its extension
VS Code Copy Path The absolute path
VS Code Copy Relative Path The workspace-relative path
Select and copy text manually The text you select inside an open file

Use this extension when you need the name alone; use VS Code's path commands when the location is needed too.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft