• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 180
  • 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
  • 2
1 Solution
 
Bill PrewCommented:
Can you share the BAT file you have so far?

~bp
0
 
Bill PrewCommented:
If you are using the NET START command then try each of these to see if one works:

NET START service-name /Y

echo Y|NET START service-name

Another approach could be to expand your script to manually STOP and START the dependent services manually rather than automatically.

~bp
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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