service restart via batch script

I have a service that i have to restart quite often to get one of the apps working.

My batch script currently is

@echo off
net stop MySvc
net start MySvc

the problem is that the "net stop MySvc" sometimes asks for a Yes/No response as it has some dependency
So, i wanted to ask if there was a way to automate the 'Y' response in that batch script ..

Please let me know

Thanks,
jibranilyasAsked:
Who is Participating?
 
BazmicCommented:
Put a /y at the end of the net stop command
IE: net stop iisadmin /y

Enjoy
0
 
dlangrCommented:
0
 
jibranilyasAuthor Commented:
Thanks Bazmic ... luv it :)

p.s. dlangr, thanks for the suggestion, i will look into that as well.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.