How to Open Notepad Using PowerShell
Introduction
Having the ability to open Notepad from PowerShell is extremely useful. It can save you time and energy by allowing you to quickly edit text files without opening the program manually.
In this article, we’ll walk through how to use PowerShell commands to open Notepad.
Solution
Using Start-Process
Once you are in PowerShell environment, you can type in Start-Process
followed by the path of your Notepad executable file.
In this case, we are going to open Notepad where the executable file is physically located at C:\WINDOWS\system32\notepad.exe
, you would type following script into PowerShell.
Start-Process 'C:\WINDOWS\system32\notepad.exe'
The Start-Process
command will launch Notepad immediately.
Using Invoke-Item
Another useful command is Invoke-Item
which can also be used to open specific item from within PowerShell. To use this command, simply enter it followed by the path of Notepad executable file.
Invoke-Item 'C:\WINDOWS\system32\notepad.exe'
This will automatically launch Notepad.
Using Call Operator (&)
Call Operator &
can also be used to open Notepad. The pattern is the same with previous example where the operator must be followed by the path to the executable file.
& 'C:\WINDOWS\system32\notepad.exe'
Conclusion
Using Windows PowerShell commands makes opening Notepad incredibly easy and efficient, just remember we can use Start-Process
, Invoke-Item
or Call Operator &
command to open the application.