I'm currently creating a .vbs script which is used to change the default program for a specific file extension however I'm not fully certain as to what registry keys/values I need to change. Doing a google search, I came across many posts in which they all mentioned to change values in HKLM, HKCR and HKCU, it was a bit confusing because it's all pointing towards different places.

Let's say I want to change the .txt file extension so it opens using CustomProgram.exe, what are all the Keys/Values and their locations in which I need to change in order for it to work without any sort of error?

marked as duplicate by DavidPostill, Community Jun 26 '15 at 10:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • @DavidPostill In that post, the answer, This is a special registry hive that combines the local user's associations in HKEY_CURRENT_USER\Software\Classes with the system's associations in HKEY_LOCAL_MACHINE\Software\Classes. but at the top he mentions that all associations are at HKEY_CLASSES_ROOT. So how do I know which keys/values to edit? – Zer0 Jun 26 '15 at 9:31
  • 1
    Possible duplicate of Programatically associate file extensions with application on Windows. One of the answers suggests changing value in HKEY_CLASSES_ROOT – DavidPostill Jun 26 '15 at 9:42
  • Thank you @DavidPostill That was exactly what I needed :) – Zer0 Jun 26 '15 at 9:47