Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 10 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.