How can i start an application from code?

D

dee

Hi
How can I start an application using .NET? I want to start notepad with
contents of a certain file.
Thanks
Dee
 
I

Imran Koradia

Shell("notepad c:\mytextfile.txt")
System.Diagnostics.Process.Start("notepad", "c:\mytextfile.txt")

For further options, take a look the Process and ProcessStartInfo classes
in the System.Diagnostics namespace.

hope that helps..
Imran.
 
D

dee

Thanks short and sweet :)

Imran Koradia said:
Shell("notepad c:\mytextfile.txt")
System.Diagnostics.Process.Start("notepad", "c:\mytextfile.txt")

For further options, take a look the Process and ProcessStartInfo classes
in the System.Diagnostics namespace.
hope that helps..
Imran.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top