Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Ветеран


Сообщения: 27449
Благодарности: 8088

Профиль | Отправить PM | Цитировать


Busla, пусть будет Start-Process, если оно позволяет сделать искомое. А оно позволяет? В случае .Net я вижу простое:
Цитата:
Examples

The following example uses the net use command together with a user-supplied argument to map a network resource. It then reads the standard error stream of the net command and writes it to console.
Код: Выделить весь код
using (Process myProcess = new Process())
{
    ProcessStartInfo myProcessStartInfo = new ProcessStartInfo("net ", "use " + args[0]);

    myProcessStartInfo.UseShellExecute = false;
    myProcessStartInfo.RedirectStandardError = true;
    myProcess.StartInfo = myProcessStartInfo;
    myProcess.Start();

    StreamReader myStreamReader = myProcess.StandardError;
    // Read the standard error of net.exe and write it on to console.
    Console.WriteLine(myStreamReader.ReadLine());
}
А как у нас обстоят дела со Start-Process здесь?

Цитата Busla:
Из широко известных примеров - 7zip при запуске через Start-Process (или прямое обращение к System.Diagnostics.Process) изредка падает. »
С чем это связано?

Отправлено: 21:01, 17-06-2020 | #17