• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 110
  • Last Modified:

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?
0
KineticNetworking
Asked:
KineticNetworking
1 Solution
 
Jeff DarlingDeveloper AnalystCommented:
One possibility is to create a text file that contains a Y and a CRLF.

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

ERASE FOO\*.*  <YES.TXT

Open in new window

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now