plz, hw can i launch notepad.exe or mspaint(or any executable program) from code in .NET
Printable View
plz, hw can i launch notepad.exe or mspaint(or any executable program) from code in .NET
using the process class.
VB.Net Code:
Process.Start("notepad")
what if its my own app?will i still use Start('...???")? after i import d required namespace?Quote:
Originally Posted by Atheist
You would usevb.net Code:
Process.Start(myAppPath)
This one is if you want command buttons to start executable files....
vb Code:
Shell ("C:\Program\something\File.exe")
Quote:
Originally Posted by marabon
shell is really only in the language for backwards compatibility from VB6.
I can't think of any valid reason to use SHELL over Process.Start() in .NET
Ok, but it still works......
True, but it may be omitted from future versions.Quote:
Ok, but it still works......
yeah it works, but all it does is launch the specified file and all it gives you in return is the processID.Quote:
Originally Posted by marabon
When you use the process class, you can do things like tell it to redirect its output to a stream in your app (great when executing command line apps), you can track the process to see if its exited, you can kill the process, you can tell it to create no window for the process, you can get the main window handle of the process, etc...
plz, whats d difference btw windows command prompt and vs.net/sdk command prompt?can aspnet_regiis b run with Process.start(...) in code to grant asp.net d the required permission account(coz when opening my web app, it says:asp.net blablabla account does not have write access to so so so...But when i added asp.net account to members of Windows administrator account, i don't get dat problem.i did it manually)