Register in the registry by Visual Basic?


  • Hi,

    I know that this will possibly be a kind of complex question, but however I had to register a specified application in registry using Visual Basic, perhaps in the App paths registry sub key in the Current User Hive. (And making it the default app to open a file type, say .example)

    (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths)

    But don't have any idea about that. Could someone here help me please? :)

    (I am using Visual Basic with .NET Framework 4.5 in Visual Studio 2017.)

    Thank you!

    Things I found until now...


    • Edited by Sithija A Monday, April 10, 2017 12:30 PM Some edits for question
    Monday, April 10, 2017 12:11 PM


All replies

  • What have you tried so far?

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Monday, April 10, 2017 12:31 PM
  • I have tried using "My.Computer.Registry.CurrentUser.CreateSubKey()" method, but it creates sub keys under HKEY_CURRENT_USER directly, so it isn't the answer.

    (I have almost tried everything in the given references.)

    Monday, April 10, 2017 12:37 PM
  • Using the registry is not difficult with VB versions newer than 6, one sample on our website


    • Edited by Cor LigthertMVP Monday, April 10, 2017 1:38 PM
    • Marked as answer by Sithija A Thursday, April 13, 2017 4:34 AM
    Monday, April 10, 2017 1:38 PM
  • But however using this to create application entries?
    Wednesday, April 12, 2017 5:00 PM
  • But however using this to create application entries?

    Be aware, there is one thing you cannot do with VB and that is overrule the OS. 

    However, beside that every key is reachable or to create.

    In the sample there is a key created and used.


    • Marked as answer by Sithija A Thursday, April 13, 2017 4:33 AM
    Wednesday, April 12, 2017 5:43 PM
  • So, is it impossible to create a registry entry for an application with Visual Basic? What I want to achieve is an installer that registers the application in registry so it can be managed through Programs & Features setting of the control panel.

    EDIT: I studied the way that the entries are created by applications, and I think that it is possible to create an entry for an application. I'm trying it now!


    • Edited by Sithija A Thursday, April 13, 2017 4:33 AM
    Thursday, April 13, 2017 4:31 AM