KRS12
asked on
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\B in"
smc -stop
::Run Program
call "C:\Program Files (x86)\Symantec\Symantec Endpoint Protection\12.1.XXXX.XXX\B in"
::enable SEP Client Service
smc -start
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\B
smc -stop
::Run Program
call "C:\Program Files (x86)\Symantec\Symantec Endpoint Protection\12.1.XXXX.XXX\B
::enable SEP Client Service
smc -start
ASKER
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]
SC [\\server] [command] [service_name] [Options]
You can't, you will have to loop over all IPs.
»bp
»bp
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER
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
ASKER
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, ??
@ECHO OFF
cmd.exe /K ""%programfiles%\symantec\
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, ??
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
»bp
ASKER
I tested this solution and it worked perfectly despite having loop all ip addresses. Thank you
So, no comments from the experts were at all useful in getting you to that solution ???
»bp
»bp
NET START SERVICENAME