Opening any exexutable file (.exe) from .Net application


Opening any exexutable file (.exe) from .Net application using VB.Net. The .exe file can be anywhere in the system.

Sometimes there are needs when we can open and run any third party executable(.exe) file from our .Net application. One living example of this type of need I felt when I was making a software for a general store and they were looking for just a same calculator like the Windows "Calculator" which will be attached with the software and when they will need some manual calculation they will use it and rest of time the original software will work. As the time and budget was very low for this project, I did attach a button which will upon clicked, bring the windows calculator.


Steps:-
1) What executable file you are wanting to open, first find that executable file's exact path using manual search.

2) Drag and Drop a button on your application.

3) Go to the button's click event by double clicking the button in the design area.

4) Write the line as it is:-


"System.Diagnostics.Process.Start("C:\WINDOWS\system32\calc.exe")"


Note: Here "calc.exe" is the executable file name of calculator. By this way, you can run any executable file(.exe) like Ms Word,Excel,Paint etc. The only difference will be, you will have to change the double quotation marked string within the parenthesis to suit the executable's exact file path.


Comments

Author: Mahesh Nagar07 Oct 2010 Member Level: Gold   Points : 0

it can also done by :
Shell("Calc.exe")



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: