Using a batch file to restart a service that has dependents.

I am trying to restart a windows service using a batch file. This windows service has two dependent services. When I run the batch file manually it ask if i want to restart the dependents services by entering a (Y)es or (N)o. When I set this up to run as a scheduled task it never completes because it is waiting for my input. How to I write the batch file to enter in Y?



One possibility is to create a text file that contains a Y and a CRLF.

then, in the batch file, use redirection like this:



One possibility is to create a text file that contains a Y and a CRLF.

then, in the batch file, use redirection like this:









Share this

Related Posts

There was an error in this gadget