Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we execute a batch file (*.bat) using Application Domain?

Tags:

c#

.net

Can we execute a batch file (*.bat) using Application Domain?

like image 842
xport Avatar asked Feb 08 '26 04:02

xport


2 Answers

No. AppDomain is a purely CLRs' concept, whereas *.bat files are executed "inside" usual Windows.

like image 191
Anton Gogolev Avatar answered Feb 12 '26 04:02

Anton Gogolev


Application Domains are a purely CLR concept, they have no relevancy to anything that's not a managed library, thus there's no way to run a batch file within an appdomain. The Process object that the batch file runs under will be tied to one specific appdomain, but it will still result in a separate process being instantiated to run your batch file.

There's some fairly good explanatory text under Remarks in the MSDN AppDomain Class documentation that should help you get a handle on what precisely an appdomain is, and what you can and can't do with one.

like image 34
Rob Avatar answered Feb 12 '26 04:02

Rob



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!