DonationCoder.com Software > Find And Run Robot
How to automatically restart a windows service?
(1/1)
Magnatolia:
Hi guys,
Is it possible to use FARR to automatically restart the windows audio service? I'm having a problem where I have to restart the service after every 1 or 2 audio files and want to try and automate this a bit more.
Thanks!
mouser:
First thing would be to find out how to make a batch file to restart the service, then you can easily invoke that batch file from FARR.
4wd:
Wouldn't it be better to discover why it's necessary to restart the service?
ie.
Is the program playing the files causing the service to screw up?
Try another program.
Is it a hardware or driver fault?
Check the Eventlog.
When the service screws up is it because it has stopped or it is running but still needs a restart?
Really need more info, it's easy to do a small PowerShell script to restart the service if its stopped but where it's still shown as running is probably going to be a little trickier since how would you know if it's being used or not?
EDIT: Can also restart the audio service using a command file, eg.
--- ---sc stop Audiosrv
ping 127.0.0.1 -n 10 >NUL
sc start Audiosrv
No checks, waits 10 seconds after stopping (ping command 10 times), then starts it.
Could add check for status with sc query Audiosrv but I think it'd be better to find out why it's necessary in the first place.
Ath:
When the service screws up is it because it has stopped
-4wd (September 22, 2017, 08:45 PM)
--- End quote ---
If that's the case, then my NANY 2013 entry KeepUpApp as featured here, could be of interest to you. It won't work if the service isn't responding for any reason though.
Navigation
[0] Message Index
Go to full version