You need to associate to the filetype the script you want to launch on that type. On Windows, all this is based on the extension (at least on XP, I don't know about 7, but I doubt it has changed).
Say the extension of your files are ".abc", and your app is:
(I dropped the variable for the moment, I'm not sure how this behaves in .reg files)
So just edit a config.reg text file that will hold the following:
Windows Registry Editor Version 5.00
; the extension .abc gets associated with a file type
; the file-type gets a name (that appears in explorer in field "type")
; What will appear in the contextual menu when selecting an .abc file
@="--- Process ! ----"
; What to do with it
; here, %1 is the file given as argument of the script
@="\"c:\\program files\\dummy\\process.bat\" \"%1\""
Finally import it. You're done.
- All the strange quotes and backslashes are there to allow correct handling of names with spaces. Yes, I now, nobody has spaces in file names.. Or do they ? Anyway, that happens!
- You can of course have several commands for a file type. Just dupe the last two keys of the .reg (cmdname-1 ==> cmdname-2)
- You can also associate different file extensions to the same file type. for example, HTML files can have either .htm or .html
- You can even associate an action to folders. replace the file type by "folder"
- It can be useful to provide a "uninstall" functionality. Just create another reg file and prefixe the created keys with '-'.