I create the notepad, and now I want to create my notepad as Default Application so that when someone going to click on txt file then it will run/load From application not by Windows Notepad..

I know How to open the text file by getting right click and run as "application name"
I tried this and also worked, But now a time when I do this I don't get my app in it, (even I browse my app and selected it get with the basic Notepad)

Is someone can help me?

Right click on a txt file and select Open With in the pop-up menu, then Choose default program. From there select your application (browse to it) and make sure Always use the selected program... is checked.

Edited 3 Years Ago by Reverend Jim

I was unable to follow the video because most of the actions were too fast. Did you browse to the folder containing your application and select the executable? I created a form with one multi-line textbox and the code

Public Class Form1

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

        Dim filename As String = My.Application.CommandLineArgs(0)
        TextBox1.Text = System.IO.File.ReadAllText(filename)

    End Sub

End Class

I created a text file with the extension xxx and set my app as the default by browsing to the exe. I double click on test.xxx and it runs my app and opens the file.

Edited 3 Years Ago by Reverend Jim

Instead of trying to get your application to work, create a new project with my controls and code and see if it works. At least you will have proof of concept and we can look elsewhere for the cause.

Yeah I know,
This code works. but before posting this I already added the code to my form and tried it so...
But it don't work for that application whileas for other application its working...
And when i tried it before completion of the application at that time it's is working, but not now,
So Can you guess me what the mistake/error that was created in it...
Some reason for it...

We know the technique works, however, it doesn't work with your code so the obvious next step is for you to post the code. Can you zip and upload the project folder?

I downloaded the project, loaded it into Visual Studio 2010 and did a build. Then I opened explorer and used Open With on temp.xxx (a text file) and set Advanced Notepad.exe in the bin\debug project folder as the default app. Now when I double click on test.xxx your application runs and loads text.xxx just like it is supposed to. As far as I can tell it is doing what you want it to do.

Comments
thanks for testing and support from you

ok thank you,
so it seems that its not working only on my pc...
as video also tell you simple that its not working...
but it work on your pc, while my other app is working so there will be some problem in my registry... (default registry) for which i am not known.|

if this is working then Thank You...

This question has already been answered. Start a new discussion instead.