I would like to pause in between two dos commands that stop and start a service.
Here is the code: ( code was borrowed from How can a windows service programmatically restart itself? )
Process proc = new Process();
ProcessStartInfo psi = New ProcessStartInfo();
psi.CreateNoWindow = true;
psi.FileName = "cmd.exe";
psi.Arguments = "/C net stop YOURSERVICENAMEHERE && net start YOURSERVICENAMEHERE";
psi.LoadUserProfile = false;
psi.UseShellExecute = false;
psi.WindowStyle = ProcessWindowStyle.Hidden;
proc.StartInfo = psi;
proc.Start();
basically, I want to put a 'pause' in between the stop and start:
psi.Arguments = "/C net stop YOURSERVICENAMEHERE && timeout /t 10 /nobreak && net start YOURSERVICENAMEHERE"