11

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?

0

1 Answer 1

18

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

.

2
  • Awesome! It worked. I didn't even have to restart. Thanks, mate. Commented May 30, 2012 at 17:54
  • 1
    Maybe %1 should be quoted in case the batch filename contains spaces. i.e. "%1" Commented Mar 6, 2018 at 19:24

You must log in to answer this question.

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