Solved

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

Posted on 2015-02-11
2
142 Views
Last Modified: 2015-02-12
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
  • 2
2 Comments
 
LVL 51

Expert Comment

by:Bill Prew
ID: 40604681
Can you share the BAT file you have so far?

~bp
0
 
LVL 51

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 40604697
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

23 Experts available now in Live!

Get 1:1 Help Now