Solved

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

Posted on 2015-02-11
1
72 Views
Last Modified: 2015-02-11
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
Comment
Question by:KineticNetworking
1 Comment
 
LVL 12

Accepted Solution

by:
Jeff Darling earned 500 total points
Comment Utility
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 your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now