Jump to content
  • Advertisement
Sign in to follow this  
Wadmar

C# Question - How to open an Executable....

This topic is 4808 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, so totally newbie question, and i'm pretty sure it can be done (I could be wrong) but I can't seem to find anywheres how to. So I thought i'd ask it here. I am looking for how to run executables (such as say... "mspaint.exe") in C#. All I need is say, code that can be thrown into like a button click that will open an executable (I hope this can be done, or i'll feel like a tool) Any help is appreciated -- Thanks ^_^ -WQ

Share this post


Link to post
Share on other sites
Advertisement

System.Diagnostics.Process.Start(Environment.GetFolderPath(System.Environment.SpecialFolder.System) + @"\mspaint.exe");

Share this post


Link to post
Share on other sites
Thanks!

It didn't automatically find the path (but I think that's because this PC doesn't have MSPAINT.EXE installed for some reason -- school PC...they suck) But I removed the special.System and put MSPAINT.EXE into the folder with the exe and it opens it.

Thanks a ton man.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!