Is it possible to use Process.Start to open a file with a program other that the default program?
For instance, like

Process.Start("C:\file.txt");

, but opening it in word instead of notepad

Recommended Answers

All 2 Replies

Yes, you can but it should be registered

Process p = new Process();
p.StartInfo.FileName = "notepad.exe"; // or "WINWORD.exe";
p.StartInfo.Arguments = "C:\\file.txt";
p.Start();

Ah thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.