3

I have log files that are named so

Service.log20150620
Service.log20150621
Service.log20150622

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 – shishir garg Jun 24 '15 at 18:40
6

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.

https://stackoverflow.com/questions/615092/log4net-rolling-file-appender-define-extension/615137#615137

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.