SolvedDefault Text Opener

Posts 1–5 of 5 · Page 1 of 1
Default Text Opener
How would I make my note pad be the default text document opener?
I tried searching it on google, but I found nothing about it.
Just right clicking and changing the default program that opens the file doesn't work.
What I want to do is, with any text file, or rich text file, or to edit a .bat, or anything like that, I want it to open it up with my note pad.
I want to pretty much completely replace note pad on my computer
Right click a text file and choose your app as default program? Or just replace notepad.exe with yours.
Quote Originally Posted by Dr. D View Post
Right click a text file and choose your app as default program? Or just replace notepad.exe with yours.
I tried that..? I guess I wasn't too clear when I said that in the first post, I'm a bit tired
And that doesn't work, it just opens my notepad, but it's blank
You'll basically need to register the extensions (.txt,.rtf,whatever extensions you want to open with your program...) with your program.
This article will give you a good idea for what you want to do: File Association in VB.NET - CodeProject
Quote Originally Posted by Pixie View Post
How would I make my note pad be the default text document opener?
I tried searching it on google, but I found nothing about it.
Just right clicking and changing the default program that opens the file doesn't work.
What I want to do is, with any text file, or rich text file, or to edit a .bat, or anything like that, I want it to open it up with my note pad.
I want to pretty much completely replace note pad on my computer
Well, i actually was hoping to find out how to do this as well and hassan's link didn't help me much, so i googled some stuff and found this.
Code:
dim filetype as string = "txt" ' change this to whatever you want the filename to be. i.e. ."boobs"'
My.Computer.Registry.ClassesRoot.OpenSubKey(filetype & "file\shell\open\command\", True).SetValue("", Application.ExecutablePath & " ""%l"" ", Microsoft.Win32.RegistryValueKind.String)
then i used this to read the text file.
Code:
Try
     If My.Application.CommandLineArgs(0) > 1 then
dim txtfile as string = My.Computer.FileSystem.ReadAllText(My.Application.CommandLineArgs(0))
    textbox1.text = txtfile
 end if
 
  Catch ex As Exception
'does nothing and loads the form if no text file is present.
End Try
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?