CMD命令讲解(一)SC

参考网站:https://technet.microsoft.com/en-us/library/bb490995.aspx

备注:网站内容是翻译得来,源网站在上面

 

SC

与服务控制器和已安装的服务进行通信。exe检索和设置关于服务的控制信息。您可以使用sc.exe来测试和调试服务程序。存储在注册表中的服务属性可以设置为控制如何在启动时启动服务应用程序,并作为后台进程运行。exe参数可以配置特定的服务,检索服务的当前状态,以及停止和启动服务。您可以创建调用各种sc.exe命令的批处理文件,以自动化启动或关闭服务的顺序。exe提供类似于控制面板中的管理工具项中的服务的功能。

对于命令语法,请单击下面的任何一个sc命令:

sc boot

表示最后一个引导是否应该被保存为最后一个良好的配置。

Syntax

sc [ServerName] boot [{bad|OK}]

Parameters

ServerName   : 指定服务所在的远程服务器的名称。名称必须使用通用命名约定(UNC)格式(“myserver”)。要在本地运行sc.exe,请忽略这个参数。

[{ bad | OK }] :指定最后一个引导是坏的还是应该作为最后一个好的引导配置来保存。

/ ?在命令提示符中显示帮助。

Examples

下面的例子展示了如何使用sc boot 命令:

sc boot ok 
sc boot bad

sc config 

在注册中心和服务控制管理器的数据库中修改服务条目的值。

Syntax

sc [ServerName] config [ServiceName] [type= {own|share|kernel|filesys|rec|adapt|interact type= {own|share}}] [start={boot|system|auto|demand|disabled}] [error={normal|severe|critical|ignore}] [binpath= BinaryPathName] [group= LoadOrderGroup] [tag={yes|no}] [depend= dependencies] [obj= {AccountName|ObjectName}] [displayname= DisplayName] [password= Password]

Parameters

ServerName   : 指定服务所在的远程服务器的名称。名称必须使用通用命名约定(UNC)格式(“myserver”)。要在本地运行sc.exe,请忽略这个参数。

ServiceName   : 指定由getkeyname操作返回的服务名称。

type= { own | share | kernel | filesys | rec | adapt | interact   type= { own | share }}   : 指定了服务类型。

Value

Description

own

服务运行在自己的进程中。它不与其他服务共享一个可执行文件。这是默认的。

share

该服务作为一个共享过程运行。它与其他服务共享一个可执行文件。

kernel

驱动程序

filesys

文件系统驱动程序。

rec

文件系统识别的驱动程序(识别计算机上使用的文件系统)。

adapt

适配器驱动程序(识别硬件项目,如键盘、鼠标和磁盘驱动器)。

interact

该服务可以与桌面交互,接收来自用户的输入。交互式服务必须在LocalSystem帐户下运行。

此类型必须与type= own或type= shared(例如,type= interact type= own)一起使用。

使用type= interact本身就会产生一个无效的参数错误。

start= { boot | system | auto | demand | disabled } : 指定服务的开始类型。

Value

Description

boot

由引导加载程序加载的设备驱动程序。

system

在内核初始化期间启动的设备驱动程序。

auto

一种服务,每当计算机重新启动并运行,即使没有人登录计算机,它也会自动启动。

demand

必须手动启动的服务。如果start=没有指定,那么这就是默认值。

disabled

无法启动的服务。要启动一个禁用的服务,将start类型更改为其他值。

error= { normal | severe | critical | ignore } : 如果服务在启动期间不能启动,则指定错误的严重程度。

Value

Description

normal

错误会被记录,并且会显示一个消息框,通知用户一个服务没有启动。程序将继续下去。这是默认设置。

severe

错误被记录(如果可能的话)。计算机试图以最后一组良好的配置重新启动。这可能导致计算机能够重新启动,但是服务可能仍然无法运行。

critical

错误被记录(如果可能的话)。计算机试图以最后一组良好的配置重新启动。如果最后一个好的配置失败了,启动也会失败,引导过程会停止错误。

ignore

错误被记录,启动继续。除了记录事件日志中的错误之外,没有通知用户。

binpath=   BinaryPathName   : 指定服务二进制文件的路径。

group=   LoadOrderGroup   : 指定该服务为成员的组的名称。组的列表存储在HKLM系统CurrentControlSet控制ServiceGroupOrder子键的注册表中。默认为空。

tag= { yes | no } : 指定是否从CreateService调用中获得一个TagID。标签只用于启动启动和系统启动驱动程序。

depend=   dependencies   : 指定必须在此服务之前启动的服务或组的名称。名称由前斜杠(/)分隔开。

obj= { AccountName | ObjectName } :指定服务将运行的帐户的名称,或指定驱动程序运行的Windows驱动程序对象的名称。缺省值是LocalSystem。

displayname=   DisplayName   : 指定一个友好的、有意义的名称,可以在用户界面程序中使用,以识别用户的服务。例如,一个服务的子键名是wuauserv,它对用户没有帮助,显示名是自动更新。

password=   Password   : 指定一个密码。如果使用的是LocalSystem帐户以外的帐户,则需要这样做。

/ ?在命令提示符中显示帮助。

Remarks

  • 如果没有一个parameter 和 value之间的空间(例如,type=属于自己,而不是类型=自身),操作就会失败。

Examples

下面的示例展示了如何使用 sc config 命令:

sc config NewService binpath= "ntsd -d c:\windows\system32\NewServ.exe"

sc continue

Sends a CONTINUE control request to a service in order to resume a paused service.

Syntax

sc [ServerName] continue [ServiceName]

Parameters

ServerName   : 指定服务所在的远程服务器的名称。名称必须使用通用命名约定(UNC)格式(“myserver”)。要在本地运行sc.exe,请忽略这个参数。

ServiceName   : Specifies the service name returned by the getkeyname operation.

/? : Displays help at the command prompt.

Remarks

  • Use the continue operation to resume a paused service.

Examples

The following example shows how you can use the sc continue command:

sc continue tapisrv

sc control

Sends a CONTROL B to a service.

Syntax

sc[ServerName] control [ServiceName] [{paramchange|netbindadd|netbindremove|netbindenable|netbinddisable|UserDefinedControlB}]

Parameters

ServerName   : 指定服务所在的远程服务器的名称。名称必须使用通用命名约定(UNC)格式(“myserver”)。要在本地运行sc.exe,请忽略这个参数。

ServiceName   : Specifies the service name returned by the getkeyname operation.

{ paramchange | netbindadd | netbindremove | netbindenable | netbinddisable | UserDefinedControlB } : Specifies a control to send to a service.

/? : Displays help at the command prompt.

sc create

在注册中心和服务控制管理器的数据库中为服务创建一个子键和条目。

Syntax

sc [ServerName] create [ServiceName] [type= {own|share|kernel|filesys|rec|adapt|interact type= {own|share}}] [start={boot|system|auto|demand|disabled}] [error={normal|severe|critical|ignore}] [binpath= BinaryPathName] [group= LoadOrderGroup] [tag={yes|no}] [depend= dependencies] [obj= {AccountName|ObjectName}] [displayname= DisplayName] [password= Password]

Parameters

ServerName   : 指定服务所在的远程服务器的名称。名称必须使用通用命名约定(UNC)格式(“myserver”)。要在本地运行sc.exe,请忽略这个参数。

ServiceName   : 指定由getkeyname操作返回的服务名称。

type= { own | share | kernel | filesys | rec | adapt | interact   type= { own | share }}   : 指定了服务类型. 默认的类型 own.

Value

Description

own

服务运行在自己的进程中。它不与其他服务共享一个可执行文件。这是默认的。

share

该服务作为一个共享过程运行。它与其他服务共享一个可执行文件。

kernel

驱动程序

filesys

文件系统驱动程序。

rec

文件系统识别的驱动程序(识别计算机上使用的文件系统)。

interact

该服务可以与桌面交互,接收来自用户的输入。交互式服务必须在LocalSystem帐户下运行。

此类型必须与type= own或type= shared(例如,type= interact type= own)一起使用。

使用type= interact本身就会产生一个无效的参数错误。

start= { boot | system | auto | demand | disabled } : 指定服务的开始类型。默认的开始是 start= demand.

  

boot

由引导加载程序加载的设备驱动程序。

system

在内核初始化期间启动的设备驱动程序。

auto

一种服务,每当计算机重新启动并运行,即使没有人登录计算机,它也会自动启动。

demand

必须手动启动的服务。这是默认值start没有指定。

disabled

无法启动的服务。要启动一个禁用的服务,将start类型更改为其他值。

error= { normal | severe | critical | ignore } : 如果服务在启动期间不能启动,则指定错误的严重程度。默认值是error= normal.

  

normal

错误会被记录,并且会显示一个消息框,通知用户一个服务没有启动。公司将继续下去。这是默认设置。

severe

错误被记录(如果可能的话)。计算机试图以最后一组良好的配置重新启动。这可能导致计算机能够重新启动,但是服务可能仍然无法运行。

critical

错误被记录(如果可能的话)。计算机试图以最后一组良好的配置重新启动。如果最后一个好的配置失败了,启动也会失败,引导过程会停止错误。

ignore

错误被记录,启动继续。除了记录事件日志中的错误之外,没有通知用户。

binpath=   BinaryPathName   : 指定服务二进制文件的路径。没有默认值 ,binpath这个字符串必须提供.

group=   LoadOrderGroup   :指定该服务为成员的组的名称。组的列表存储在注册表中 HKLM\System\CurrentControlSet\Control\ServiceGroupOrder subkey. 默认为空。

tag= { yes | no } : 指定是否从CreateService调用中获得一个TagID。标签只用于启动启动和系统启动驱动程序。

depend=   dependencies   : 指定必须在此服务之前启动的服务或组的名称。名称由前斜杠(/)分隔开。

obj= { AccountName | ObjectName } : 指定服务将运行的帐户的名称,或指定驱动程序运行的Windows驱动程序对象的名称。

displayname=   DisplayName   : 指定一个友好的名称,用户界面程序可以使用它来标识服务。

password=   Password   : 指定一个密码。如果使用的是LocalSystem以外的帐户,则需要这样做。

/? : 在命令提示符中显示帮助。 

Remarks

  • 没有参数和值之间的空格操作将会失败(正确:type= own, 错误:type=own),

Examples

下面的例子展示了如何使用 sc create 命令:

sc \\myserver create NewService binpath= c:\windows\system32\NewServ.exe 
sc create NewService binpath= c:\windows\system32\NewServ.exe type= share start= auto depend= "+TDI Netbios"

sc create ServerWCF binPath= "F:/SalesAndSalesManagement/ServerWCF/bin/Release/ServerWCF.exe" TYPE= "own" start= "auto" TAG= "no" DisplayName= "ServerWCF"

 

sc delete

从注册表中删除服务子键。如果服务正在运行,或者另一个进程对服务有一个打开的句柄,那么该服务将被标记为删除。

Syntax

sc [ServerName] delete [ServiceName]

Parameters

ServerName   : 指定服务所在的远程服务器的名称。名称必须使用UNC格式(“myserver”)。要在本地运行sc.exe,请忽略这个参数。

ServiceName   : 指定由该服务返回的服务名称 getkeyname 操作.

/? :在命令提示符中显示帮助。

Remarks

  • 使用添加或删除程序来删除DHCP、DNS或任何其他内置的操作系统服务。添加或删除程序不仅会删除服务的注册表子键,还会卸载服务并删除服务的任何快捷方式。

Examples

下面的示例展示了如何使用 sc delete 命令:

sc delete newserv

 

sc description

为服务设置描述字符串。

Syntax

sc [ServerName] description [ServiceName] [Description]

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

ServiceName   : Specifies the service name returned by the getkeyname operation.

Description   : Specifies a description for the specified service. If no string is specified, the description of the service is not modified. There is no limit to the number of characters that can be contained in the service description.

/? : Displays help at the command prompt.

Examples

The following example shows how you can use the sc description command:

sc description newserv "Runs quality of service control."

sc enumdepend

Lists the services that cannot run unless the specified service is running.

Syntax

sc [ServerName] enumdepend [ServiceName] [BufferSize]

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

ServiceName   : Specifies the service name returned by the getkeyname operation.

BufferSize   : Specifies the size (in bytes) of the enumeration buffer. The default is 1024 bytes.

/? : Displays help at the command prompt.

Remarks

  • If the buffer is not big enough, the enumdepend operation will output dependencies only partially, and will specify the additional buffer size required to output all dependencies. If the output is truncated, rerun the operation and specify the larger buffer size.

Examples

The following examples show how you can use the sc enumdepend command:

sc enumdepend rpcss 5690 
sc enumdepend tapisrv

sc failure

Specifies what action to take upon failure of the service.

Syntax

sc [ServerName] failure [ServiceName] [reset= ErrorFreePeriod] [reboot= BroadcastMessage] [command= CommandLine] [actions= FailureActionsAndDelayTime]

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

ServiceName   : Specifies the service name returned by the getkeyname operation.

reset=   ErrorFreePeriod   : Specifies the length of the period (in seconds) with no failures after which the failure count should be reset to 0. This parameter must be used in conjunction with the actions= parameter.

reboot=   BroadcastMessage   : Specifies the message to be broadcast upon failure of the service.

command=   CommandLine   : Specifies the command line to be run upon failure of the service. For more information about how to run a batch or VBS file upon failure, see Remarks.

actions=   FailureActionsAndDelayTime   : Specifies the failure actions and their delay time (in milliseconds) separated by the forward slash (/). The following actions are valid: run, restart, and reboot. This parameter must be used in conjunction with the reset=parameter. Use actions= "" to take no action upon failure.

/? : Displays help at the command prompt.

Remarks

  • Not all services allow changes to their failure options. Some run as part of a service set.

  • To run a batch file upon failure, specify cmd.exe Drive:\FileName.bat to the command= parameter, where Drive:\FileName.batis the fully qualified name of the batch file.

  • To run a VBS file upon failure, specify cscript drive:\myscript.vbs to the command= parameter, where drive:\myscript.vbs is the fully qualified name of the script file.

  • It is possible to specify three different actions to the actions= parameter, which will be used the first, second, and third time a service fails.

  • Without a space between a parameter and its value (that is, type= own, not type=own), the operation will fail.

Examples

The following examples show how you can use the sc failure command:

sc failure msftpsvc reset= 30 actions= restart/5000 
sc failure dfs reset= 60 command= c:\windows\services\restart_dfs.exe actions= run/5000 
sc failure dfs reset= 60 actions= reboot/30000 
sc failure dfs reset= 60 reboot= "The Distributed File System service has failed. Because of this, the computer will reboot in 30 seconds." actions= reboot/30000 
sc failure myservice reset= 3600 reboot= "MyService crashed -- rebooting machine" command= " %windir%\MyServiceRecovery.exe" actions= restart/5000/run/10000/reboot/60000

sc getdisplayname

Gets the display name associated with a particular service.

Syntax

sc [ServerName] getdisplayname [ServiceName] [BufferSize]

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

ServiceName   : Specifies the service name returned by the getkeyname operation.

BufferSize   : Specifies the size (in bytes) of the buffer. The default is 1024 bytes.

/? : Displays help at the command prompt.

Examples

The following examples show how you can use the sc getdisplayname command:

sc getdisplayname clipsrv 
sc getdisplayname tapisrv 
sc getdisplayname sharedaccess

sc getkeyname

Gets the key name associated with a particular service, using the display name as input.

Syntax

sc [ServerName] getkeyname [ServiceDisplayName] [BufferSize]

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

ServiceDisplayName   : Specifies the display name of the service.

BufferSize   : Specifies the size (in bytes) of the buffer. The default is 1024 bytes.

/? : Displays help at the command prompt.

Remarks

  • If the ServiceDisplayName contains spaces, use quotation marks around the text (that is, "Service Display Name").

Examples

The following examples show how you can use the sc getkeyname command:

sc getkeyname "remote procedure call (rpc)" 
sc getkeyname "internet connection sharing" 
sc getkeyname clipbook

sc interrogate

Sends an INTERROGATE control request to a service.

Syntax

sc [ServerName] interrogate [ServiceName]

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

ServiceName   : Specifies the service name returned by the getkeyname operation.

/? : Displays help at the command prompt.

Remarks

  • Sending INTERROGATE to a service causes the service to update its status with the Service Control Manager.

Examples

The following examples show how you can use the sc interrogate command:

sc interrogate sharedaccess 
sc interrogate rpcss

sc lock

Locks the Service Control Manager's database.

Syntax

sc [ServerName] lock

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

/? : Displays help at the command prompt.

Remarks

  • Locking the Service Control Manager's database prevents any services from starting. Use this if you want to make sure that a service will not be started after it has been stopped. This will allow you to take some action (for example, deleting the service) without interference.

  • Using the lock operation locks the Service Control Manager's database and then allows the database to be unlocked by typingu. You can also kill the process from which you locked the database.

Examples

The following example shows how you can use the sc lock command:

sc lock

sc pause

Sends a PAUSE control request to a service.

Syntax

sc [ServerName] pause [ServiceName]

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

ServiceName   : Specifies the service name returned by the getkeyname operation.

/? : Displays help at the command prompt.

Remarks

  • Use the pause operation to pause a service before shutting it down.

  • Not all services can be paused.

  • Not all services perform the same when paused. Some continue to service existing clients, but refuse to accept new clients. Others cease to service existing clients and also refuse to accept new ones.

Examples

The following example shows how you can use the sc pause command:

sc pause tapisrv

sc qc

Queries the configuration information for a service.

Syntax

sc [ServerName] qc [ServiceName] [BufferSize]

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

ServiceName   : Specifies the service name returned by the getkeyname operation.

BufferSize   : Specifies the size (in bytes) of the buffer. The default is 1024 bytes.

/? : Displays help at the command prompt.

Remarks

  • The qc operation displays the following information about a service: SERVICE_NAME (service's registry subkey name), TYPE, ERROR_CONTROL, BINARY_PATH_NAME, LOAD_ORDER_GROUP, TAG, DISPLAY_NAME, DEPENDENCIES, and SERVICE_START_NAME.

  • Administrators can use SC to determine the binary name of any service and find out if it shares a process with other services by typing the following at the command line:

    sc qc ServiceName

    SC can help match up services in the Services node of Microsoft Management Console (MMC) with processes in System Monitor. If the binary name is Services.exe, then the service shares the Service Controller process.

    Services.exe starts all services. To conserve system resources, several Win32 services developed for Windows are written to share the Services.exe process. These services are not listed as separate processes in System Monitor or Task Manager. The same is true of Svchost.exe which is a service host process that many operating services share.

    There might not be a process for every Win32 service because third-party Win32 services can also be configured to share processes. SC can be used to get configuration information on these services. If a service does not share its process with other services, however, there will be a process for it in System Monitor when the service is running.

  • SC can be useful for developers of services because it provides more detailed and accurate information about services than Services.exe, which is included with Windows. Services.exe can determine whether a service is running, stopped, or paused. Although these tools are adequate for a debugged application that is running smoothly, the information they provide about a service being developed can be misleading. For example, a service that is starting is shown as started whether it is actually running or not.

    SC implements calls to all Windows service control application programming interface (API) functions. Set the parameters to these functions by specifying them at the command line.

    Using SC, you can query the service status and retrieve the values stored in the status structure fields. Services.exe cannot provide you with the complete status of a service, but SC shows the exact state of the service, as well as the last checkpoint number and wait hint. You can use the checkpoint as a debugging tool because it indicates how far the initialization progressed before the program stopped responding. SC also lets you specify the name of a remote computer so that you can call the service API functions or view the service status structures on a remote computer.

Examples

The following examples show how you can use the sc qc command:

sc qc \\myserver newsrvice 
sc qc rpcss 248

sc qdescription

Displays the description string of a service.

Syntax

sc [ServerName] qdescription [ServiceName] [BufferSize]

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

ServiceName   : Specifies the service name returned by the getkeyname operation.

BufferSize   : Specifies the size (in bytes) of the buffer. The default is 1024 bytes.

/? : Displays help at the command prompt.

Examples

The following examples show how you can use the sc qdescription command:

sc qdescription rpcss 
sc qdescription rpcss 138

sc qfailure

Displays the actions that will be performed if the specified service fails.

Syntax

sc [ServerName] qfailure [ServiceName] [BufferSize]

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

ServiceName   : Specifies the service name returned by the getkeyname peration.

BufferSize   : Specifies the size (in bytes) of the buffer. The default is 1024 bytes.

/? : Displays help at the command prompt.

Remarks

  • The qfailure operation displays the following information about a service: SERVICE_NAME (service's registry subkey name), RESET_PERIOD, REBOOT_MESSAGE, COMMAND_LINE, and FAILURE_ACTIONS.

Examples

The following examples show how you can use the sc qfailure command:

sc qfailure rpcss 
sc qfailure rpcss 20

sc query

Obtains and displays information about the specified service, driver, type of service, or type of driver.

Syntax

sc [ServerName] query [ServiceName] [type= {driver|service|all}] [type= {own|share|interact|kernel|filesys|rec|adapt}] [state={active|inactive|all}] [bufsize= BufferSize] [ri= ResumeIndex] [group= GroupName] 

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

ServiceName   : Specifies the service name returned by the getkeyname operation. This query parameter is not used in conjunction with other query parameters (other than ServerName).

type= { driver | service | all }   : Specifies what to enumerate. The default type is service.

Value

Description

driver

Specifies that only drivers are enumerated.

service

Specifies that only services are enumerated.

all

Specifies that both drivers and services are enumerated.

type= { own | share | interact | kernel | filesys | rec | adapt }   : Specifies the type of services or type of drivers to enumerate.

Value

Description

own

The service runs in its own process. It does not share an executable file with other services. This is the default.

share

The service runs as a shared process. It shares an executable file with other services.

interact

The service can interact with the desktop, receiving input from users. Interactive services must be run under the LocalSystem account.

kernel

Driver.

filesys

File system driver.

state= { active | inactive | all }   : Specifies the started state of the service for which to enumerate. The default state is active.

Value

Description

active

Specifies all active services.

inactive

Specifies all paused or stopped services.

all

Specifies all services.

bufsize=   BufferSize   : Specifies the size (in bytes) of the enumeration buffer. The default size is 1024 bytes. Increase the size of the enumeration buffer when the display resulting from a query exceeds 1024 bytes.

ri=   ResumeIndex   : Specifies the index number at which to begin or resume the enumeration. The default is 0. Use this parameter in conjunction with the bufsize= parameter when more information is returned by a query than the default buffer can display.

group=   GroupName   : Specifies the service group to enumerate. The default is all groups.

/? : Displays help at the command prompt.

Remarks

  • Without a space between a parameter and its value (that is, type= own, not type=own), the operation will fail.

  • The query operation displays the following information about a service: SERVICE_NAME (service's registry subkey name), TYPE, STATE (as well as states which are not available), WIN32_EXIT_B, SERVICE_EXIT_B, CHECKPOINT, and WAIT_HINT.

  • The type= parameter can be used twice in some cases. The first appearance of the type= parameter specifies whether to query services, drivers, or all. The second appearance of the type= parameter specifies a type from the create operation to further narrow a query's scope.

  • When the display resulting from a query command exceeds the size of the enumeration buffer, a message similar to the following is displayed:

    Enum: more data, need 1822 bytes start resume at index 79

    To display the remaining query information, rerun query, setting bufsize= to be the number of bytes and ri= to the specified index. For example, the remaining output would be displayed by typing the following at the command line:

    sc query bufsize= 1822 ri= 79

Examples

The following examples show how you can use the sc query command:

sc query 
sc query messenger 
sc query type= driver 
sc query type= service 
sc query state= all 
sc query bufsize= 50 
sc query ri= 14 
sc query type= service type= interact 
sc query type= driver group= ndis

sc queryex

Obtains and displays extended information about the specified service, driver, type of service, or type of driver.

Syntax

sc [ServerName] queryex [type= {driver|service|all}] [type= {own|share|interact|kernel|filesys|rec|adapt}] [state={active|inactive|all}] [bufsize= BufferSize] [ri= ResumeIndex] [group= GroupName]

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

ServiceName   : Specifies the service name returned by the getkeyname operation. This queryex parameter is not used in conjunction with any other queryex parameters except ServerName.

type= { driver | service | all }   : Specifies what to enumerate. The default type is service.

Value

Description

driver

Specifies that only drivers are enumerated.

service

Specifies that only services are enumerated.

all

Specifies that both drivers and services are enumerated.

type= { own | share | interact | kernel | filesys | rec | adapt } : Specifies the type of services or type of drivers to enumerate.

Value

Description

own

The service runs in its own process. It does not share an executable file with other services. This is the default.

share

The service runs as a shared process. It shares an executable file with other services.

interact

The service can interact with the desktop, receiving input from users. Interactive services must be run under the LocalSystem account.

kernel

Driver.

filesys

File system driver.

state= { active | inactive | all }   : Specifies the started state of the service for which to enumerate. The default state is active.

Value

Description

active

Specifies all active services.

inactive

Specifies all paused or stopped services.

all

Specifies all services.

bufsize=   BufferSize   : Specifies the size (in bytes) of the enumeration buffer. The default size is 1024 bytes.

ri=   ResumeIndex   : Specifies the index number at which to begin or resume the enumeration. The default is 0.

group=   GroupName   : Specifies the service group to enumerate. The default is all groups.

/? : Displays help at the command prompt.

Remarks

  • Without a space between a parameter and its value (that is, type= own, not type=own), the operation will fail.

  • The queryex operation displays the following information about a service: SERVICE_NAME (service's registry subkey name), TYPE, STATE (as well as states that are not available), WIN32_EXIT_B, SERVICE_EXIT_B, CHECKPOINT, WAIT_HINT, PID, and FLAGS.

  • The type= parameter can be used twice in some cases. The first appearance of the type= parameter specifies whether to query services, drivers, or all. The second appearance of the type= parameter specifies a type from the create operation to further narrow a query's scope.

  • When the display resulting from a queryex command exceeds the size of the enumeration buffer, a message similar to the following is displayed:

    Enum: more data, need 2130 bytes start resume at index 75

    To display the remaining queryex information, rerun queryex, setting bufsize= to be the number of bytes and ri= to the specified index. For example, the remaining output would be displayed by typing the following at the command line:

    sc queryex bufsize= 2130 ri= 75

Examples

The following examples show how you can use the sc queryex command:

sc queryex messenger 
sc queryex group= ""

sc querylock

Queries and displays the lock status for the Service Control Manager's database.

Syntax

sc [ServerName] querylock

Parameter

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

/? : Displays help at the command prompt.

sc sdset

Sets a service's security descriptor using Service Descriptor Definition Language (SDDL).

Syntax

sc [ServerName] sdset ServiceName ServiceSecurityDescriptor

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

ServiceName   : Specifies the service name returned by the getkeyname operation.

ServiceSecurityDescriptor   : Specifies the service descriptor in SDDL.

/? : Displays help at the command prompt.

Remarks

  • For more information about SDDL, see "Security Descriptor Definition Language" at the MSDN Online Library .

sc sdshow

Displays a service's security descriptor using SDDL.

Syntax

sc [ServerName] sdshow ServiceName

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

ServiceName   : Specifies the service name returned by the getkeyname operation.

/? : Displays help at the command prompt.

Remarks

  • For more information about SDDL, see "Security Descriptor Definition Language" at the MSDN Online Library .

Examples

sc sdshow rpcss

sc start

Starts a service running.

Syntax

sc [ServerName] start ServiceName [ServiceArguments]

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

ServiceName   : Specifies the service name returned by the getkeyname operation.

ServiceArguments   : Specifies service arguments to pass to the service to be started.

/? : Displays help at the command prompt.

Examples

The following example shows how you can use the sc start command:

sc start tapisrv

sc stop

Sends a STOP control request to a service.

Syntax

sc [ServerName] stop ServiceName

Parameters

ServerName   : Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

ServiceName   : Specifies the service name returned by the getkeyname operation.

/? : Displays help at the command prompt.

Remarks

  • Not all services can be stopped.

Examples

The following example shows how you can use the sc stop command:

sc stop tapisrv

Remarks

Formatting legend

Format

Meaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

 

 

 

转载于:https://www.cnblogs.com/Leon-Jenny/p/7542239.html

Windows CMD命令行高效操作与批处理脚本实战 命令行界面(CLI)作为操作系统最底层的交互方式,通过文本命令直接控制系统资源,具有图形界面无法比拟的执行效率和自动化能力。其核心原理是通过命令解释器解析用户输入,调用对应的系统API完成操作。在Windows环境中,CMD命令提示符作为经典命令行工具,特别适合快速文件操作、系统配置和批量任务处理。掌握CMD命令可以显著提升IT运维、软件开发等工作效率,比如用dir命令快速检索文件,通过taskkill终止异常进程,或编写批处理脚本实现自动化部署。在服务器维护、批量文件处理等场景中,合理使用xcopy、ro 阅读详情

相关推荐

Windows CMD命令详解与实用技巧

命令行界面(CLI)是操作系统与用户交互的基础方式之一,Windows CMD作为内置命令行解释器,通过文本指令实现高效系统管理。其核心原理是通过解析用户输入的命令字符串,调用对应的系统功能或程序执行。掌握CMD命令不仅能提升系统管理效率,还能实现批量自动化操作,特别适合文件管理、网络配置和系统维护等场景。本文重点介绍Windows CMD的启动方式、文件目录操作、系统管理命令等实用技巧,包含dir、xcopy等高频命令的使用方法,以及批处理脚本编写等进阶内容,帮助用户从基础到精通掌握这一系统管理利器。

weixin_34417183的博客 582

Windows服务“允许服务与桌面交互”的使用和修改方法

 描述:在自己写的一个系统服务程序,需要经常用到“允许与桌面进行交互”的设置,网上很多使用修改注册表的形式实现,我测试过,修改注册表后,选中的勾是选上了,但不能弹出应用程序;据说重启电脑后可以,但我不想重启,实际应用也不允许重启,故没有测试重启是否可行的情况。如图: 例如:当我需要运行服务程序的时候,弹出我的应用程序,则要在Windows服务“允许服务与桌面交互”中打勾,当

喜怒形于色 2万+

Windows CMD命令详解:从入门到系统管理实战

命令行界面(CLI)作为操作系统最核心的人机交互方式,通过文本指令直接调用系统功能,在自动化运维和高效开发中具有不可替代的优势。Windows命令提示符(CMD)作为微软系统的标准CLI环境,其底层基于NT内核的命令解释器实现,支持通过管道和重定向实现命令组合。掌握CMD命令不仅能完成文件操作、系统配置等基础任务,还能实现网络诊断、服务管理等高级功能,特别适合批量处理、故障排查等场景。本文以dir、xcopy、ipconfig等高频命令为例,结合磁盘清理、进程管理等实际案例,演示如何通过robocopy多线

weixin_34005042的博客 385

cmd-sc命令详解

SC命令详解 介绍SC,SC QC,and SC QUERY SC使用这样的语法: 1. SC [Servername] command Servicename [Optionname= Optionvalues] 2. SC [command] 这里使用第一种语法使用SC,使用第二种语法显示帮助。 下面介绍各种参数。 Servername 可选择:...

weixin_34383618的博客 1131

CTFShow萌新区全攻略:从密码破解到Web渗透的实战解析

本文为CTFShow萌新区新手提供从密码破解到Web渗透的完整实战攻略。文章深入解析了密码学、隐写术、杂项和Web安全四大核心方向,分享了实用的解题工具、思维方法和绕过技巧,旨在帮助初学者建立系统的安全竞赛解题体系,而不仅仅是提供一份题解(WP)。

weixin_29216957的博客 289

永磁同步电机FOC控制实战:如何用线性死区补偿解决低速抖动问题(附Matlab仿真代码)

本文详细介绍了永磁同步电机FOC控制中线性死区补偿技术的工程实现方法,有效解决低速抖动问题。通过Matlab/Simulink仿真验证,该方案可将转矩脉动降低70%以上,显著提升系统稳定性。文章包含完整的数学模型构建、Simulink实现步骤及参数整定技巧,为工程师提供实用解决方案。

weixin_30872499的博客 145

Windows通过sc命令修改服务的描述信息

示例: sc description MySQL "MySQL数据库服务" MySQL:服务名称 最后的字符串就是服务的描述信息,自行修改即可~~~

ctrigger的专栏 2881

ANSYS Workbench接触分析实战:从算法选择到收敛难题破解

本文深入解析ANSYS Workbench接触分析的核心技术与实战技巧,涵盖四大接触算法选择、收敛难题破解秘籍及典型场景参数设置。通过实际案例演示如何优化接触刚度、pinball区域和非对称行为等关键参数,帮助工程师有效解决结构非线性问题,提升仿真效率和精度。

weixin_28705087的博客 355

Windows控制台命令行的sc命令

SC命令是XP系统中功能强大的DOS命令,SC命令能与“服务控制器”和已安装设备进行通讯。SC是用于与服务控制管理器和服务进行通信的命令行程序。

kfepiza的博客 1713

手把手教你用ADuC845 DAC调试恒流电路(附实测数据与避坑指南)

本文详细介绍了如何利用ADuC845 DAC调试恒流电路,包括硬件搭建、DAC输出校准、低端死区问题解决方案及系统级调试技巧。通过实测数据和避坑指南,帮助工程师快速解决非线性输出和稳定性问题,提升电路性能。

life6的博客 331

【微电网优化】基于粒子群求解CHP机组、气网、电网、储热罐和电锅炉微电网优化模型附matlab代码

1 简介 我国风力发电近年发展迅速,装机容量已成为全球首位.随着风力发电在电力系统中的渗透率不断提高,我国多个地区(尤其是"三北"地区)已经面临着十分严峻的风电消纳问题,产生不容忽视的弃风问题.针对目前我国风电消纳存在的困难,本文提出粒子群优化CHP机组、气网、电网、储热罐和电锅炉微电网控制策略. 2 部分代码 Ppv=[0;0;0;0;0;0;9.86000000000000;19.0100000000000;33.1000000000000;45.0700000000000;64.7900000

qq_59747472的博客 664

windows进阶-cmd命令

Windows CMD 是一个功能强大的命令行工具,能够帮助用户高效地执行许多系统管理任务。无论是管理服务、操作注册表、执行远程桌面连接,还是进行进程控制,CMD 都为用户提供了丰富的功能。在日常工作中,掌握这些命令可以提高工作效率,简化系统管理流程。

weixin_43759894的博客 1512

RT-DETR改进策略【模型轻量化】| 替换骨干网络为 2024轻量化网络MoblieNetV4:移动生态系统的通用模型

本文记录的是基于MobileNet V4的RT-DETR目标检测轻量化改进方法研究。通过整合UIBMobile MQA以及优化的NAS策略能够在在不降低性能指标的前提下,降低计算成本。本文配置了原论文中和五种模型,以满足不同的需求。

Limiiiing的博客 1916

在CMD下使用sc命令,报openservice failed 1060错误

在CMD下使用sc命令,报openservice failed 1060错误

qq_43741193的博客 1万+

【Bluetooth|蓝牙开发】三、一篇文章,带你总览蓝牙协议

1、开篇词 2、蓝牙开发入门 3、蓝牙协议栈总览 4、蓝牙协议栈——物理层 5、蓝牙协议栈——链路层 6、蓝牙协议栈——传输层 7、蓝牙协议栈——L2CAP协议 8、蓝牙协议栈——ATT协议 9、蓝牙协议栈——GATT协议 10、蓝牙通信流程分析 11、蓝牙协议栈——Bluez交叉编译 12、蓝牙调试工具汇总

Donge's Blog 1万+

【批处理DOS-CMD命令-汇总和小结】-cmd的内部命令和外部命令怎么区分,CMD命令和运行(win+r)命令的区别,cmd的命令扩展(扩展命令)

区分规则很简单,在cmd窗口中用help命令能打印出来的命令都是cmd内部命令,没包括在里面的都是外部命令。 内部命令的实现代码,全放在cmd.exe可执行程序中,而外部命令的实现代码独立地放在了其他可执行程序中;比如说外部命令where对应system32文件夹下的where.exe文件,而外部命令shutdown也对应system32文件夹下的shutdown.exe文件,而外部命令wget、python则对应用户安装时放置的路径中的wget.exe、python.exe文件。外部命令可以拓展,而内

小坏蛋的博客 2312

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

ADSP SC58x SC584 SC587 SC589 读写EMMC简易教程

ADSP SC58x SC584 SC587 SC589 读写EMMC简易教程 一、官方SDK并没有提供EMMC读写教程,但是提供了SD卡读写教程,由于SD卡和EMMC底层使用的API是相同的,可参考。SD卡例程地址 https://www.analog.com/cn/design-center/evaluation-hardware-and-software/software/adswp-ucf...

Six44的博客 1685

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

CMD批处理笔记

CMD批处理笔记

weixin_43465752的博客 4314

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Windows CMD命令与系统维护实战技巧

命令提示符(CMD)是Windows系统管理的核心工具,通过命令行接口实现高效的系统操作与维护。其工作原理基于Windows NT内核提供的命令行解释器,能够直接调用系统API执行底层操作。在技术价值方面,CMD命令相比图形界面具有更高的执行效率和自动化潜力,特别适合批量处理、远程管理等场景。实际应用中,从基础的文件操作(dir/copy)到高级的系统配置(SC/netstat),CMD覆盖了磁盘维护、网络调试、服务控制等关键运维需求。通过批处理脚本(.bat)还能实现任务自动化,结合Windows任务计划

weixin_30895059的博客 321

自学渗透测试第七天(Windows基础与cmd命令)

本文系统介绍了Windows系统基础与渗透测试技术要点。主要内容包括:1) Windows核心架构解析,涵盖文件系统、用户权限、注册表和服务进程管理;2) CMD/PowerShell实用命令集,包含系统信息收集、网络诊断、文件操作和注册表管理等渗透测试必备技能;3) 实战任务指导,如系统画像构建、敏感文件搜索和用户权限提升操作;4) 常见问题解决方案,包括权限提升、命令语法差异和安全特性绕过技巧。该内容旨在为安全测试人员提供Windows环境下的技术参考,同时强调需在合法授权范围内谨慎操作。

2303_79682882的博客 738

​Windows常用shell命令大全​

大多数默认的 Shell命令对应目标程序打多在“C:/Windows/”及“C:/Windows/System32”目录下。这里的servername,servicename,optionname,optionvalues和上面的一样,这里就option描述,通常为键值对应:option name = option values。注意这个名称是不同于显示名称的(这个名称可以用net start和服务控制面板看到),而SC是使用服务键名来鉴别服务的。/p 只能和 /d 一起使用。默认是nothing。

Albert__Einstein的博客 9140

cmd+lcx+nc+sc提权工具总结

cmd:执行命令的载体cmdshell   lcx:端口映射工具 1.在自己的host上的cmd下运行:lcx.exe -listen 51 3389 //意思是监听51端口并转发到3389端口 2.在服务器器上运行:lcx.exe -slave myip 51 serverip 3389 //意思是把服务器的3389端口转发到自己的host的51端口 3.在自己的host上的cmd下运...

weixin_33910759的博客 241

CMD基本指令汇总

一,CMD基本操作 1.操作文件和文件夹 D: #切换至D盘,盘间切换不能用 cd cd D:\CMD #进入文件夹D:\CMD md 数据存储 #在当前文件夹中创建 数据存储 文件夹,即 D:\CMD\CMD实验环境\数据存储 copy 开心.txt D:\CMD\CMD实验环境\数据存储 #文件复制:将文件移动到指定文件夹 dir #显示当前文件夹所有文件和目录 dir D:\CMD\CMD实验环境\数据存储 #显示指定文件夹所有文件和目录 del 数据.xlsx

weixin_45590329的博客 774

Windows CMD命令行高效运维实战指南

命令行工具作为操作系统最底层的交互方式,在系统管理和自动化运维中具有不可替代的价值。Windows CMD通过轻量级的命令解析引擎,实现了对文件系统、进程管理和网络配置的精准控制,其批处理脚本功能更是自动化运维的核心技术之一。在服务器维护、批量文件处理等场景中,熟练使用`robocopy`、`tasklist`等命令组合可以大幅提升工作效率。本文深入解析200+实用CMD命令,特别分享通过`forfiles`实现日志轮转、利用`wmic`检测异常进程等实战技巧,帮助开发者掌握Windows系统管理的底层方法

562
上一篇: EF基于方法的查询语法
下一篇: 获取根目录地址
dieduishi5940
博客等级 码龄11年 0粉丝 0原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值