Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I remember in Windows XP where you could edit file associations to not only change what program would open certain files, but edit individual items in a file's right-click context menu. You could also edit command line options if you wanted.

I'd like to do this with batch files so that I can change the Edit option to open the batch file with Notepad2. Double-clicking would still execute the Open command so the batch file executes as normal.

It appears that this advanced functionality in Windows 7 has been removed and replaced by feature that simply allows you to change what program a file opens with. Any way I can get a batch file to open for edit in a text editor of my choice?

share|improve this question
up vote 13 down vote accepted

The association can be found in the Windows registry

HKEY_CLASSES_ROOT\batfile\shell\edit\command

default data is

%SystemRoot%\System32\NOTEPAD.EXE %1

You could change the Data target to your program of choice.

enter image description here

.

I used this program to find it

.

share|improve this answer
    
Should I restart the computer to make it done? I changed the key for "C:\Program Files\Notepad++\notepad++.exe %1" but "Edit" keep opening on Windows notepad... – Diogo May 30 '12 at 17:50
    
opps, this only works for batfiles, I was trying to open .txt files... It worked now.... Sorry :D – Diogo May 30 '12 at 17:52
    
Awesome! It worked. I didn't even have to restart. Thanks, mate. – oscilatingcretin May 30 '12 at 17:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .