Open Notepad++ from PowerShell

Inside powershell I can simply use the start and get general results

to open a python file with notepad++ here is what I did.

Start notepad++ ex1.py

this will start notepad++ and load the file ex1.py assuming you are in the same directory as the .py file. You can change that by adding the full path name

start notepad++ c:\users\you\desktop\files\ex1.py

Hope this helps!


Because the default path contains spaces, you have to quote the path to the exe. However because PowerShell is also a scripting language. A string by itself is simply evaluated as a string e.g.:

C:\ PS> 'Hello world'
Hello world

So you have to tell PowerShell you want to invoke the command that is named by the string. For that you use the call operator & e.g.:

C:\ PS> & 'C:\Program Files (x86)\Notepad++\notepad++.exe'

or if notepad++ is in your path:

  C:\ PS> notepad++

or if you're in the same dir as the exe:

  C:\ PS> .\notepad++