Creating New Services with sc.exe Command


How to use sc.exe command to create a new service?


If you want to create a new service, you can use the "create" commanded offered by the sc.exe tool. Before running this command, you need to prepre the following minimum information:
  • Service Name: A single work to name the new service.
  • Binary Path: The path name where the executable program for new service is located.
  • Dispaly Name: A short name for the new service.

Run sc.exe in a command window and follow this tutorial:

C:\>sc create CalcService binPath= c:\windows\system32\calc.exe
   DisplayName= Calculator

[SC] CreateService SUCCESS

C:\>sc query CalcService

   TYPE               : 10  WIN32_OWN_PROCESS
   STATE              : 1  STOPPED
   WIN32_EXIT_CODE    : 1077       (0x435)
   SERVICE_EXIT_CODE  : 0  (0x0)
   CHECKPOINT         : 0x0
   WAIT_HINT          : 0x0

Note that the "=" sign is part of the command option name, and you must enter a space between the option name and the option value.

2007-01-01, 24519🔥, 0💬