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

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

+3
source share
3 answers

Application areas are purely the concept of the CLR, they have nothing to do with anything but a managed library, so there is no way to run a batch file inside the application. The object the Processbatch file is working with will be bound to one specific application domain, but it will still lead to the creation of a separate process for launching your batch file.

MSDN AppDomain Class , , appdomain, .

+2

. AppDomain - CLR, *.bat "" Windows.

+3

If you need to execute a batch file from your C #, use a class Process.

Process myProcess = new Process();
myProcess.StartInfo.FileName = "C:\\HelloWorld.bat";
myProcess.Start();

Batch files are not part of the CLR and therefore cannot be run in AppDomain.

+2
source

Source: https://habr.com/ru/post/1756884/


All Articles