I added a batch (.bat) file to my project. I want to add a new editor for batch files that would actually execute this batch file in command prompt window.
What I did, but didn't remember my editor:
- Right clicked on my .bat file
- Selected Open with…
- Clicked Add
- Set program as "cmd /c" and some Friendly name
- Accepted this dialog.
- A new window appears that tells me it can't validate editor path (because of the additinoal parameter, because if I remove it, it works)
- My new editor is in the window.
When I open the same Open with… dialog again, my editor isn't present.
How should I tackle this?
Best Answer
Ok. I managed to solve this myself.
As I found on the internet this is a Visual Studio bug, so it doesn't remember these kind of editors (parametrised executable file names). But nonetheless. The solution goes like this:
Put this code in it:
@cmd /c %1
Then add the new editor in Visual Studio by pointing to this ExecuteBatch.cmd file.
Voila. Problem solved. Detailed instructions can be found in this blog post.