Video Screencast Help

Script to Restart the Client Service

Created: 01 Mar 2013 • Updated: 13 Mar 2013 | 3 comments
AjinBabu's picture
+1 1 Vote
Login to vote

Hi All,

Good Day.

We usually experience Disabled SEP clients across our Customer sites. And as a preliminary step we used to restart the service of the client. After logging to the client.

Here I am attached a psexec script which can execute remotely on the systems.


  1. Since 32 bit and 64 bit machines are installed on different location we required two different script to stop the service
  2. It is not a 100 % automated script we need to type the command manually (only commands like smc.exe –start and smc.exe –stop )

How it works

The script uses PSEXEC from a free tool which uses port 445 to communicate to the client, which is used to communicate between the Server or client.

(before starting the script Download and keey the psexec.exe to system32 folder )


  1. Copy and paste the computer names from the disabled list to 32_bit_Hostlist.txt or 64_bit_Hostlist.txt wrt to the OS versions. (Normally we having majority 32 bit systems if a 64 bit OS computer added to the 32 bit host list noting will happen it will result “path not found and vice versa”)
  2. Double click on the Restart_Service_32_Bit.CMD / Restart_Service_64_Bit.CMD wt to 32 bit OS and 64 bit OS
  3. After giving command smc.exe –start / smc.exe –stop we need to exit from the console by exit command
  4. If the computer is offline or port not open it will result a output that path could not found
  5. If the command run successfully it will result a exit with an error code 0

Please find the attached Zip file for scripts

This solution works for my environment

Best Regards


Comments 3 CommentsJump to latest comment

John Santana's picture

Thanks for sharing the script !

Kind regards,

John Santana
IT Professional


The author cannot accept liability for any loss or damage sustained as a result of the content of this post.

Login to vote
consoleadmin's picture

Nice Script.


Login to vote
Ambesh_444's picture

Good one man!!!!

Good luck for next!!!

Thank& Regards,


"Your satisfaction is very important to us. If you find above information helpful or it has resolved your issue. Please don't forget to mark the thread as   solved."

Login to vote