Enable Services

I need to be able to write a batch file that will stop a service.  I know the ip addresses but I don't know how to write this into a batch file.  I need to be able to start and stop this service weekly on all computers and where it is a workgroup, I cannot do so through a gpo.  Workstations are XP

I have started this:

@ECHO OFF

::disable SEP Client Service

::Run Program

call "C:\Program Files (x86)\Symantec\Symantec Endpoint Protection\12.1.XXXX.XXX\Bin"

smc -stop

::Run Program

call "C:\Program Files (x86)\Symantec\Symantec Endpoint Protection\12.1.XXXX.XXX\Bin"

::enable SEP Client Service

smc -start
KRS12Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tom CieslikIT EngineerCommented:
NET STOP SERVICENAME

NET START SERVICENAME
0
Bill PrewIT / Software Engineering ConsultantCommented:
Take a look at the SC command.

SC


»bp
1
KRS12Author Commented:
I think the sc command is perfect, but how can I include an ip scope for all the computers?  Rather than list one computer at a time?
SC [\\server] [command] [service_name] [Options]
0
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Bill PrewIT / Software Engineering ConsultantCommented:
You can't, you will have to loop over all IPs.


»bp
0
KRS12Author Commented:
Can I still call the path?  

@ECHO OFF

::disable SEP Client Service

SC [\\10.10.10.10] [stop] [smc]

::Run Program

::call "C:\Program Files (x86)\Symantec\Symantec Endpoint Protection\12.1.XXXX.XXX\Bin"
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bill PrewIT / Software Engineering ConsultantCommented:
If you are wanting to execute that Bin file on the local machine, then yes.  If you are trying to execute it on the remote machine, then that won;t work.  And should you be calling an EXE, nit the BIN folder?  Or is BIN.EXE a program?

If you want to perform actions on every PC you might want to look at PSEXEC, it can allow running programs remotely, if your environment is set up properly.  Or perhaps consider Powershell...



»bp
0
KRS12Author Commented:
I cannot use PsExec for this task, it is not installed and I cannot install this due to policy.  I have to find a way to stop the services on every computer.  I have a mixed network.  Some computers are on a domain and some in a workgroup, but all are reaching from our server.  I can ping all the machines
0
KRS12Author Commented:
I have gotten this far:  

@ECHO OFF
cmd.exe /K ""%programfiles%\symantec\symantec endpoint protection\smc.exe" -stop
echo End of script.
pause

How can I run this on all computers, I am missing a line where I need to list the computer ip, ??
0
Bill PrewIT / Software Engineering ConsultantCommented:
It feels like you got some value form the expert comments on this question, did you not feel any were worthy of selecting as Solution or Assist?  Or were none useful?


»bp
0
KRS12Author Commented:
I tested this solution and it worked perfectly despite having  loop all ip addresses.  Thank you
0
Bill PrewIT / Software Engineering ConsultantCommented:
So, no comments from the experts were at all useful in getting you to that solution ???


»bp
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.