I am running one file in LaTeX (through MiKTeX) it is having error; when I am entering the errorstopmode 'e' on the console the TeX file is opening in the TeXworks editor, but I want to open in WinEdt, how to change the default editor in MiKTeX?
The first solution is that you reinstall WinEdt over the existing installation, and, during the same, you select "Associate TeX Filetypes with WinEdt".
The installer has admin privileges so this is the best way to go. Note that none of your customizations will be lost by this process.
A second way to go is to associate filetypes directly within WinEdt (not recommended unless you start WinEdt with admin privileges: Options -> Configuration Wizard -> Start WinEdt as Admin").
To do that open the Configuration Wizard (under the Options menu) and go to the "Filetypes Associations" tab.
There select "Modify filetypes associations" button (All or current user depending on the fact that you have admin privileges)
Then choose the filetypes you want to associate with WinEdt.
Note that you may have to restart your PC to make the changes effective.
Note also that if you are running latex through the command line this may not suffice.
In this case you have two options:
Set the environmental variable MIKTEX_EDITOR to WinEdt, that is, in the command line write:
set MIKTEX_EDITOR="C:\<winedt_path>\WinEdt.exe" "[Open(|%f|);SelPar(%l,7);]"
Edit the MiKTeX configuration file and add a line for the "editor" value, that is, in the command line write:
and, in the file that gets opened, write
and then save.