Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running shell commands in ASP.NET

How do i run a shell command in asp.net ?

I basically want something like system("netstat -an");

I don't want the output to be displayed to the user. Just want to run some maintenance commands.

like image 975
demos Avatar asked Oct 26 '25 19:10

demos


2 Answers

call System.Diagnostics.Process.Start("netstat", "-an"); as usually

like image 99
abatishchev Avatar answered Oct 29 '25 08:10

abatishchev


Use Process.Start:

Process.Start("netstat", "-an");
like image 30
Oded Avatar answered Oct 29 '25 09:10

Oded



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!