Launch txt file in deafult text editor
-
I need a function that launches a text file in the users default text editor. It would be easy enough to launch notepad, but notepad is horrid. How to I grab the executable that is used for the .txt extension. I assume this is a registry thing, and I have avoided the registry in the past. Thanks.
***************** "We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
-
I need a function that launches a text file in the users default text editor. It would be easy enough to launch notepad, but notepad is horrid. How to I grab the executable that is used for the .txt extension. I assume this is a registry thing, and I have avoided the registry in the past. Thanks.
***************** "We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
You use Process.Start and pass it the path to your txt file. It's probably going to open notepad.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
I need a function that launches a text file in the users default text editor. It would be easy enough to launch notepad, but notepad is horrid. How to I grab the executable that is used for the .txt extension. I assume this is a registry thing, and I have avoided the registry in the past. Thanks.
***************** "We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
Hi, if you pass a .txt file as the command to Process.Start() it will be opened by whatever app is associated to the .txt extension (which could be Notepad of course). :)
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips: - use PRE tags to preserve formatting when showing multi-line code snippets - before you ask a question here, search CodeProject, then Google
-
Hi, if you pass a .txt file as the command to Process.Start() it will be opened by whatever app is associated to the .txt extension (which could be Notepad of course). :)
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips: - use PRE tags to preserve formatting when showing multi-line code snippets - before you ask a question here, search CodeProject, then Google
Both of you THANKS! and DUH on me. Many users will have notepad, but I know the particular user I am dealing with uses textpad. I wanted it to just call whatever is associated. Thanks again.
***************** "We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW