I have log files that are named so


How can I associate all of them with a program in Windows 7 without doing it individually for each extension?

  • 2
    It would be easier if you named your logfiles Service.[date].log. .log files are already associated with notepad (by default)
    – DavidPostill
    Jun 24 '15 at 18:35
  • I know it would be easier, but that's how log4net does it by default. Also I have lot of older log files I want to open with a double click in this convention Jun 24 '15 at 18:40

You can't.

The file associations are stored individually under HKEY_CLASSES_ROOT in the registry. Even similar extensions are stored separately: .jpeg .jpg, .htm .html.

Consider adjusting the filename output format to Service.<date>.log. If this is not possible to configure, write a script which periodically renames the files appropriately.

EDIT (you mentioned log4net): According to the following StackOverflow post, you should be able to modify the logfile format to put the date earlier in the filename.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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