By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,566 Members | 1,783 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,566 IT Pros & Developers. It's quick & easy.

run exe from asp.net

P: n/a
How can I run the program i.e.notepad.exe from asp.net c#?

Thanks..
Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Selen" <sk*****@yahoo.com> wrote in message
news:ez**************@TK2MSFTNGP12.phx.gbl...
How can I run the program i.e.notepad.exe from asp.net c#?


Presumably, you mean you want to create a web page in ASP.NET which will
allow clients to run Notepad on their local machine? If so, just use WSH and
javascript:

<script>

var WshShell = new ActiveXObject("WScript.Shell")
WshShell.Run ("notepad.exe")

</script>
Nov 15 '05 #2

P: n/a
ProcessStartInfo psi = new ProcessStartInfo("notepad.exe");
psi.WindowStyle = ProcessWindowStyle.Hidden;

Process p = new Process();
p.EnableRaisingEvents = true;
p.Exited += new EventHandler(MyExited);
p.StartInfo = psi;
p.Start();

..... do stuff ...

p.Kill(); // Try killing the process

private void MyExited(object sender, EventArgs e)
{
MessageBox.Show("Exited process");
}

This will run notepad "hidden" (for illustration purposes).. Then p.Kill();
should kill it.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Mark Rae" <ma**@markrae.co.uk> wrote in message
news:up**************@TK2MSFTNGP10.phx.gbl...
"Selen" <sk*****@yahoo.com> wrote in message
news:ez**************@TK2MSFTNGP12.phx.gbl...
How can I run the program i.e.notepad.exe from asp.net c#?
Presumably, you mean you want to create a web page in ASP.NET which will
allow clients to run Notepad on their local machine? If so, just use WSH

and javascript:

<script>

var WshShell = new ActiveXObject("WScript.Shell")
WshShell.Run ("notepad.exe")

</script>

Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.