tehadm
Администратор
- Сообщения
- 1 159
- Реакции
- 293
C#:
private void StartCmdWithBatch(string nameOfBatchFile)
{
//if (!File.Exists(nameOfBatchFile))
// throw new FileNotFoundException(nameOfBatchFile);
string parameters = string.Format("/k \"{0}\"", nameOfBatchFile);
Process.Start("cmd", parameters);
}
Пример вызова:
C#:
StartCmdWithBatch("del /q /f /s %WINDIR%\\Temp\\*.*");