Table of Contents
In PowerShell or Command Prompt, run edit "notes.txt" to open a text file in Microsoft Edit. If Windows doesn’t recognize edit, install the open-source editor or run the release executable directly. Editing an ordinary file in your own folder doesn’t require administrator rights.
Install Microsoft Edit if it isn’t already available
On a PC with Windows Package Manager, open a terminal and run:
winget install --id Microsoft.Edit --exact
Open a new terminal afterward if the command isn’t recognized. You can also download the appropriate release archive from the Microsoft Edit repository, extract it, and launch edit.exe from that folder. If multiple copies are installed, where.exe edit shows the locations Windows finds.


Open, edit, and save a file
Run Edit from the folder containing the file or give it a full path. Put the full path in double quotes if it contains spaces.
edit "notes.txt"
edit "My script.bat"Use Ctrl + S to save, Ctrl + F to find text, and Ctrl + Z to undo. The on-screen menus show the shortcuts for your installed version.



Edit scripts without running them
Edit opens batch and PowerShell scripts as text. Saving your changes doesn’t execute the script. Review the commands and test your own changes from the shell when you’re ready. Start in a folder you can write to if you’re learning, so permissions on system files don’t interfere.


For related shell commands, see the Windows and PowerShell references in the TipsMake utility hub.
Reader Comments 0
Sign in with email or Google to join the discussion.