Sc.exe ?? ????? ?? Windows ?? ???? ???? ?? ????? ?? ??? ???? ????

???? ?????? ???? ??????
???? ID: 251192 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
??? ?? ??????? ???? | ??? ?? ??????? ????

?? ????? ??

??????

?????? ??? ?? ????? ?? ???? ?????? ?? ??? ???? ??????? ????, ?? SC ????? (Sc.exe) ?????? ??? ??? ????? ?? ?? ????? ?? ?????

?????? ?? ???? ?????? ???????? ?? ???? ???? ?? ??????? ???? ?? ??? Netsvc.exe ?? Instsrv.exe ??????? ?? ????? ?? ???? ???, ?? ??????? ???? ???? ???? ?????? ??? ?? ??? ???? ????? ?? ?????? ???

???:Srvinstw.exe ?????, ???????? ???? ??????? (GUI) ??????? ?????? ?????? ?? ????? ?? ??? ????? ???? ???? ??? Srvinstw.exe ?? ????-?????? ????? ???? ???

???? ???????

?? Windows ?? ??? ?????? ?? ?????? ???? ??? ??? ???? ?? ??? Sc.exe ?? ????? ?? ???? ???? Sc.exe, ?????? ??? ??? ?????? ??, ?? ??? Windows ???? ???????? ????????? ??????? (API) ?????? ???????????? ????? ?? ???? ???? ??? ?? ??? ?? ???? ??? ???????? ?? ?????? ?? ??? ????? ???? ?? ????????? ??????? Sc.exe ?? ???? ?? ?????? ????????? ???? ?? ?? ?????? ?? ?????? ????? ??? ???????? ????? ?? retrieves. ????? ?? ???? ??? ???? ?????? ???????? ?? ??? ????????? ???? ????? ?? ?? ???? API ?????? ?? ??? ?? ???? ??? ?? ?????? ???????? ?? ???? ?????? ???????? ?? ??????

Sc.exe ???? ?? ???? ???????? API ?????? ??? ?? ???? ?????? ???????? ?? ???? ?? ???-??? ???? ???? ??? ?? ???? ?? ??? ??? ?? ?? ?? ??? ????? ?? ????????? ?? ???? ???????? ??????? ??????? ??? ????? ???? ?? ???????? ???? ?? ??? ?? ????????? ????? ?????? ???? ??? ?? ???????? ??? ?? ????????? ??? ???????????? ?? ????? ?? ???? ??? ???? ??????? ?? ?????? ???? ?? ??? ???? ???????? ??????? ?? ????? ???? ?? ??? ???????? ?? ???????? ?? ???? ?? ???????? ???? ?? ??? ???? ???

Sc.exe ????? ???????? ?? ????? ???? ??:

Syntax1 (Sc.exe ????? ?? ??? Syntax1 ?? ????? ????)
Sc [Servername] ???? Servicename [Optionname Optionvalue ??... =]
Syntax2 (Syntax2 ?? ??? ?? ?? ??? ??, ??? ??????? ????????? ???? ?? ??? ????? ??????????????)
Sc [????]

????????

  • Servername
    ???????? ??? ????? ?? ??? ????????? ???? ?? ?? ?? ???? ?????? ???????? ?? ???? ?? ????? ????? ???? ??? ?? (\) ???????? ?????? ?? ??? ??????? ???? ????? (?????? ?? ???, \\myserver). ??????? ???????? ?? Sc.exe ?? ????? ?? ??? ???? ??????? ?? ?????????
  • ????
    ????????? ???? ??Sc????? ???? ?? ?? ???Sc???? ????????? ???????? ?? ???????????? ??????????? ?? ???????? ??? Sc.exe ????? ?????? ?? ?????? ???? ??:
    ????????
    ???? ???? (???????) ?? ??????????? ????????? ???? ???

    ???? ????
    ???? ???? ?? ??? ???? ???? ???????? ?????? ????? ???

    ????????
    ???? ???? ?? ??? ???? ???????? ????? ???

    ?????
    ???? ???? (??? ?? ????? ?? ?????????) ????? ???

    ?????
    ???? ???? (?????????) ?? ????? ???

    EnumDepend
    ???? ?????????? enumerates ???

    GetDisplayName
    ???? ?? ??? DisplayName obtains ???

    GetKeyName
    ???? ?? ??? ServiceKeyName obtains ???

    Interrogate
    ???? ???? ?? ??? ?? Interrogate ???????? ?????? ????? ???

    ????? ???
    ???? ???? ?? ??? ??? ????? ???????? ?????? ????? ???

    qc
    ???????? ??????????? ???? ?? ??? ??? ??????? ??????? ?? ??? ?????? ???, "SC QC." ?????

    ??????
    ???? ?? ??? ?????? ?? ?????????, ?? ?????? ?? ?????? ?? ??? ?????? enumerates. ??????? ??????? ?? ??? ?????? ???, "SC ??????." ?????

    ???????
    ???? ???? ??????? ?? ???? ??

    STOP:
    ???? ???? ??? ?????? ????? ???
  • Servicename
    ????????? ??? ????? ???? ?? ??? ??? ?? ??? ????????? ???? ??? ????? ??? ?? ?? ???????? ??? ?? ????? ?? (?? ?? ?? ??? ???? ???????? ??????????? ?? ???????? ???? ??? ?????? ?????? Sc.exe ????? ???? ????? ??? ?? ??? ??? ???????? ?????????? ???? ?? ????
  • Optionname
    Optionname ?? Optionvalue ???????? ??? ?? ???? ?? ???????? ???????? ?? ??? ?? ????????? ???? ?? ?????? ??? ????? ??? ?? ?? Optionname ?? ????? ????? ?? ??? ????? ???? ??? ?? ??? ????, ?? ?? ???? ???????? ???????? ??? ?? ??? ????? ?? ??????? ?? ???? ????
  • Optionvalue
    ???????? ?????? Optionname ??? ?? ??? ??? ????????? ???? ??? ????? ????? ?? ?????? Optionname ???????? ?? ??? ?????????? ??? ?????? ????? ?? ?? ???? ?? ??? ??? ?? ???????? ???? ?? ??? ?????? ?????
?? ???? ?????????? ??????????? ?? ???????? ??? Make sure that you are an administrator of the computer where the development is being performed.

Thesc createcommand creates an entry for the service in the registry and in the Service Control Manager database.

Syntax
sc [Servername] create Servicename [Optionname= Optionvalue...

????????

  • Servername
    Optional. Specifies the name of the server when you want to run the commands on a remote computer. The name must start with two backslash characters (for example, \\myserver). To run SC on the local computer, do not supply this parameter.
  • Servicename
    Specifies the name given to the service key in the registry. Note that this is different from the display name, which is what you see withnet startand the Services tool in Control Panel. Sc.exe uses the service key name as the primary identifier for the service.
  • Optionname
    The Optionname and Optionvalue parameters allow you to specify the names and values of optional parameters. Note that there is no space between the Optionname and the equal sign. You can supply none, one, or more optional parameters name and value pairs. Thesc querycommand supports the following values:OptionnameOptionvalue
    type=own, share, interact, kernel, filesys
    Type of service you want to create. Optionvalues include types used by drivers.
    (default = share)

    start=boot, system, auto, demand, disabled
    Start type for the service. Option values include types used by drivers.
    (default = demand)

    error=normal, severe, critical, ignore
    Severity of error if the service does not start during boot.
    (default = normal)

    binPath=(string)
    Path name to the service binary file. There is no default for this parameter. This string must be supplied.

    group=(string)
    Name of group which this service is a member of. The list of groups are stored in the registry under ServiceGroupOrder.
    (default = nothing)

    tag=(string)
    If this string is set to "yes," Sc.exe obtains a TagId from the CreateService call, however, Sc.exe does not display the tag.
    (default = nothing)

    depend=(space separated string)
    Names of services or groups that must start before this service.

    obj=(string)
    Name of account in which the service runs. For drivers, this is the Windows driver object name.
    (default = LocalSystem)

    DisplayName=(string)
    A string that can be used by user-interface programs to identify the service.

    password=(string)
    A password string. This is required if an account other than LocalSystem is used.
Optionvalue
Specifies the value for the parameter named by Optionname. See the Optionname reference for a list of supported values. When a string is to be input, the use of empty quotes means that an empty string is passed in. Note that there is a space betweenOptionValueand the equal sign.

???:Thesc createcommand performs the operations of the CreateService API function.

The following example creates a registry entry for the service named "NewService" on the computer called \\remotecomputer:
sc \\remotecomputer create newservice binpath= c:\nt\system32\newserv.exe
???:In Windows 2000, Windows XP, Windows Server 2003, Windows Vista, and Windows Server 2008, the binpath is located at C:\Windows\System32\Newserv.exe.

This service is created as a WIN32_SHARE_PROCESS with a SERVICE_DEMAND_START start-type by default. It does not have any dependencies, and runs in the LocalSystem security context.

The following example creates the service on the local computer as an auto-start service that runs in its own process. It has dependencies on the TDI group and on the NetBIOS service. Notice that you must add quotes around the list of space-separated dependencies.
sc create newservice binpath= c:\nt\system32\newserv.exe type= own start= auto depend= "+tdi netbios"
???:In Windows 2000, Windows XP, Windows Server 2003, Windows Vista, and Windows Server 2008, the binpath is located at C:\Windows\System32\Newserv.exe.

???? ????? ?? ??? Sc.exe ????? ?? ???? ???, ????? ?????? ??? ??? Sc dev.txt ???????? ?????? ?? ???????? ??? ???? ??????? Sc.exe ?? ????? ???? ???

???

???? ID: 251192 - ????? ???????: 11 ??????? 2011 - ??????: 3.0
???? ???? ???? ??:
  • Microsoft Windows NT Server 3.51
  • Microsoft Windows NT Server 4.0 Standard Edition
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
  • Microsoft Windows Server 2003, Datacenter Edition for Itanium-Based Systems
  • Microsoft Windows Server 2003, Datacenter x64 Edition
  • Microsoft Windows Server 2003, Enterprise x64 Edition
  • Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
  • Microsoft Windows Server 2003, Enterprise Edition for Itanium-based Systems
  • Microsoft Windows Server 2003, Standard x64 Edition
  • Microsoft Windows Server 2003, Standard Edition (32-bit x86)
  • Windows Vista Home Basic
  • Windows Vista Home Basic N
  • Windows Vista Home Basic N 64-bit Edition
  • Windows Vista Business
  • Windows Vista Business 64-bit edition
  • Windows Vista Business N
  • Windows Vista Business N 64-bit Edition
  • Windows Vista Home Premium
  • Windows Vista Home Basic 64-bit edition
  • Windows Vista Home Premium 64-bit edition
  • Windows Vista Ultimate
  • Windows Vista Ultimate 64-bit edition
  • Microsoft Windows XP Home Edition
  • Microsoft Windows XP Professional
  • Windows Server 2008 Standard
  • Windows Server 2008 Enterprise
  • Windows Server 2008 Datacenter
??????: 
kbhowto kbexpertiseinter kbinfo kbmt KB251192 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:251192

??????????? ???

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com