Batch File Help

Associate
Joined
26 Jul 2007
Posts
941
This is probably a very basic and easy to answer question for someone who knows. But ive not really done anything with Scripting.

All i want to do is create a batch file that will run via scheduled tasks.

I want it to restart a service every day. My problem is that the service has dependancies which in turn im happy for them to be restarted also.

So obviously i have the following in the batch file.

net stop "Service Name"
net start "Service Name"

but when this runs it prompts in a ms dos box to hit Y or N (i need Y obviously) to restart the dependant services. and then Hit Enter. How do i go about doing this within the batch file ?

Thanks
 
Are you doing?

net stop "Service Name 1"
net stop "Service Name 2"
net stop "Service Name 3"

net start "Service Name 1"
net start "Service Name 2"
net start "Service Name 3"

yeh?


No just the one Service because it has 3 other Dependancies which will asked to be restarted along with it.

Tried the Echo Y| but it just stays on the

"Do you want to continue this operation? <Y/N> [N]:"

And obviously if i manually type Y and then hit enter it does what i want it to, but i want ti know if this can be done automaticaly.

Thanks
 
Back
Top Bottom