How to edit text files directly from Command Prompt and PowerShell on Windows 11 — using Microsoft Edit just like Linux's Nano

Microsoft Edit UI
Microsoft Edit's simple UI. (Image credit: Mauro Huculak)

On Windows 11, you can use the Microsoft Edit tool to work with text files while in Command Prompt or PowerShell without having to switch applications, and in this guide, I'll show you everything you need to know to get started.

Microsoft Edit is a simple utility that is under 250KB, similar to Linux command-line editors such as Nano, Vim, and Micro.

How to use Microsoft Edit on Windows 11

Microsoft now ships the Edit command-line tool with the latest version of the operating system, but you can install it manually if it's not yet available on your device.

Installation

To install Microsoft Edit on Windows 11, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and choose the Run as administrator option.
  3. Type the following winget command to install Microsoft Edit and press Enter: winget install --id Microsoft.Edit

(Image credit: Mauro Huculak)

Microsoft Edit is an open-source tool also available through the official GitHub page. If you want to get it manually from the release page, download the latest version's zip file, extract it, and run edit.exe to launch the application.

If you're getting the tool from GitHub, you'll also have to configure it manually. This requires placing the "edit.exe" file in a new folder and creating the environment variable. Since this requires additional steps, it's recommended to use the Windows Package Manager (winget) tool to install it.

Usage

The usage of the tool is really straightforward:

  1. Open Start.
  2. Search for Command Prompt and right-click the top result.
  3. (Option 1) Type this command to launch Microsoft Edit and press Enter: edit

(Image credit: Mauro Huculak)
  1. (Option 2) Type this command to launch the Edit command-line tool as an administrator and press Enter: sudo edit
  • Quick note: If you need to edit a text file that requires higher privileges, you can also start the Command Prompt as an administrator.

Once you launch the text editor, you can start managing existing or new files.

Opening file

To edit an existing text file, use these commands: edit filename.txt

(Image credit: Mauro Huculak)

You can also launch the tool from any location, specifying the path: edit c:\path\filename.txt

It's also possible to launch the editor and open the text file. First, type this command: edit

Once in the editor, click on "File," choose "Open File," and select the text file.

(Image credit: Mauro Huculak)

Creating file

To create a new text file, use these commands: edit filename.txt

It's also possible to launch the editor and then create the text file. First type this command: edit

Once in the editor, click on "File" and choose "New File." This action will create an untitled text file.

(Image credit: Mauro Huculak)

Editing file

While in the Microsoft Edit tool, the options are limited to those available in a basic text editor. For example, from the "Edit" menu, you can access actions like undo, redo, cut, copy, and paste.

(Image credit: Mauro Huculak)

You can also use the find and replace functionality built into the tool.

(Image credit: Mauro Huculak)

In the "View" menu, you can manage options like Work Wrap and control the status bar, and switch between text files.

(Image credit: Mauro Huculak)

Saving file

After you finish working with a text file, you can use the "Ctrl + S" shortcut to save its content, or from the "File" menu, select the "Save" or "Save As" option.

To exit the editor, you can use the "Ctrl + Q" shortcut or, from the "File" menu, choose the "Exit" option.

(Image credit: Mauro Huculak)

Before wrapping things up, you can always use the "Esc" key to dismiss a menu or another UI element. In addition, virtually every action has a keyboard shortcut. You can learn them while in each of the available menus. All the shortcuts start with "Ctrl+," except the Word Wrap feature, which uses the "Alt + Z" shortcut.

This tool does not reinvent text file editing. Its purpose is to provide the operating system with a native text editor that runs directly in Command Prompt and PowerShell, eliminating the need to switch to a separate app. And as Notepad continues to gain more features, including AI integrations, Microsoft Edit now serves as a lightweight alternative focused on basic, distraction-free text editing.

FAQs about Microsoft Edit

These are common questions regarding the Microsoft Edit tool on Windows 11.

What is Microsoft Edit on Windows 11?

Microsoft Edit is a lightweight, command-line text editor built into Windows 11 that lets you create and edit text files directly from Command Prompt or PowerShell without switching to a graphical app.

Is Microsoft Edit the same as Notepad?

No. Notepad is a full graphical text editor with an expanding feature set, including AI-powered tools. Microsoft Edit is designed for terminal-based workflows and focuses on fast, basic, distraction-free text editing.

Do I need to install Microsoft Edit manually?

On newer versions of Windows 11, Microsoft Edit is already included. If it is not available on your system, you can install it manually using the Windows Package Manager with the winget install --id Microsoft.Edit command.

Can I use Microsoft Edit on Windows 10 or Linux?

Yes. Microsoft Edit works on Windows 11 and Windows 10, and it is also available on Linux. It is an open-source project hosted on GitHub.

How is Microsoft Edit different from older MS-DOS Editor?

Microsoft Edit is a modern replacement with 64-bit support, active development, and cross-platform availability.

Can Microsoft Edit open and edit existing files?

Yes. You can open existing text files by specifying the filename or full path when launching the tool, or by opening files from the "File" menu once inside the editor.

Can Microsoft Edit create new text files?

Yes. You can create a new file by specifying a new filename when launching the edit command or by creating a new file from within the editor interface.

Does Microsoft Edit support advanced editing features?

No. The editor intentionally keeps features minimal. It supports basic actions such as undo, redo, cut, copy, paste, find, replace, and word wrap.

More resources

Explore more in-depth how-to guides, troubleshooting advice, and essential tips to get the most out of Windows 11 and 10. Start browsing here:


Follow us on Google Discover.

Follow Windows Central on Google News to keep our latest news, insights, and features at the top of your feeds!


Mauro Huculak
Windows How-To Expert

Mauro Huculak has been a Windows How-To Expert contributor for WindowsCentral.com for nearly a decade and has over 22 years of combined experience in IT and technical writing. He holds various professional certifications from Microsoft, Cisco, VMware, and CompTIA and has been recognized as a Microsoft MVP for many years.

You must confirm your public display name before commenting

Please logout and then login again, you will then be prompted to enter your display name.