日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

SC-控制Windows服务的命令

發布時間:2025/7/14 windows 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 SC-控制Windows服务的命令 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Windows自帶一個控制服務的命令-SC,下面用Terminal Service做個簡單例子: 查詢Terminal Service的配置 C:\Users\jackie.chen&gt;sc qc termservice [SC] QueryServiceConfig SUCCESS SERVICE_NAME: termservice?? ??????? TYPE?????????????? : 20? WIN32_SHARE_PROCESS??? ??????? START_TYPE???????? : 2?? AUTO_START??? ??????? ERROR_CONTROL????? : 1?? NORMAL??? ??????? BINARY_PATH_NAME?? : C:\Windows\System32\svchost.exe -k NetworkService??? ??????? LOAD_ORDER_GROUP?? :??? ??????? TAG??????????????? : 0??? ??????? DISPLAY_NAME?????? : Terminal Services??? ??????? DEPENDENCIES?????? : RPCSS??? ?????????????????????????? : TermDD??? ??????? SERVICE_START_NAME : NT Authority\NetworkService 關閉Terminal Service服務 C:\Users\jackie.chen&gt;sc stop termservice SERVICE_NAME: termservice?? ??????? TYPE?????????????? : 20? WIN32_SHARE_PROCESS??? ??????? STATE????????????? : 3? STOP_PENDING??? ??????????????????????????????? (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)??? ??????? WIN32_EXIT_CODE??? : 0? (0x0)??? ??????? SERVICE_EXIT_CODE? : 0? (0x0)??? ??????? CHECKPOINT???????? : 0x1??? ??????? WAIT_HINT????????? : 0xea60 查詢Terminal Service服務 C:\Users\jackie.chen&gt;sc query termservice SERVICE_NAME: termservice?? ??????? TYPE?????????????? : 20? WIN32_SHARE_PROCESS??? ??????? STATE????????????? : 1? STOPPED??? ??????? WIN32_EXIT_CODE??? : 0? (0x0)??? ??????? SERVICE_EXIT_CODE? : 0? (0x0)??? ??????? CHECKPOINT???????? : 0x0??? ??????? WAIT_HINT????????? : 0x0 啟動Terminal Service服務 C:\Users\jackie.chen&gt;sc start termservice SERVICE_NAME: termservice?? ??????? TYPE?????????????? : 20? WIN32_SHARE_PROCESS??? ??????? STATE????????????? : 2? START_PENDING??? (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN) ??????? WIN32_EXIT_CODE??? : 0? (0x0)??? ??????? SERVICE_EXIT_CODE? : 0? (0x0)??? ??????? CHECKPOINT???????? : 0x0??? ??????? WAIT_HINT????????? : 0x7d0??? ??????? PID??????????????? : 1456??? ??????? FLAGS????????????? : 查詢Terminal Service服務的顯示名稱 C:\Users\jackie.chen&gt;sc getdisplayname termservice???? [SC] GetServiceDisplayName SUCCESS??? Name = Terminal Services 更多用法: sc <server> [command] [service name] <option1> <option2>... The option <server> has the form \\ServerName (用于控制遠程機器上的Windows服務)?? ??????? Further help on commands can be obtained by typing: "sc [command]"??? ??????? Commands:??? ????????? query-----------Queries the status for a service, or enumerates the status for types of services.??? ????????? queryex---------Queries the extended status for a service, or enumerates the status for types of services.??? ????????? start-----------Starts a service.??? ????????? pause-----------Sends a PAUSE control request to a service.??? ????????? interrogate-----Sends an INTERROGATE control request to a service.??? ????????? continue--------Sends a CONTINUE control request to a service.??? ????????? stop------------Sends a STOP request to a service.??? ????????? config----------Changes the configuration of a service (persistent).??? ????????? description-----Changes the description of a service.??? ????????? failure---------Changes the actions taken by a service upon failure.??? ????????? failureflag-----Changes the failure actions flag of a service.??? ????????? sidtype---------Changes the service SID type of a service.??? ????????? privs-----------Changes the required privileges of a service.??? ????????? qc--------------Queries the configuration information for a service.??? ????????? qdescription----Queries the description for a service.??? ????????? qfailure--------Queries the actions taken by a service upon failure.??? ????????? qfailureflag----Queries the failure actions flag of a service.??? ????????? qsidtype--------Queries the service SID type of a service.??? ????????? qprivs----------Queries the required privileges of a service.??? ????????? delete----------Deletes a service (from the registry).??? ????????? create----------Creates a service. (adds it to the registry).??? ????????? control---------Sends a control to a service.??? ????????? sdshow----------Displays a service's security descriptor.??? ????????? sdset-----------Sets a service's security descriptor.??? ????????? showsid---------Displays the service SID string corresponding to an arbitrary name.??? ????????? GetDisplayName--Gets the DisplayName for a service.??? ????????? GetKeyName------Gets the ServiceKeyName for a service.??? ????????? EnumDepend------Enumerates Service Dependencies. The following commands don't require a service name:?? ??????? sc <server> <command> <option>??? ????????? boot------------(ok | bad) Indicates whether the last boot should??? ????????????????????????? be saved as the last-known-good boot configuration??? ????????? Lock------------Locks the Service Database??? ????????? QueryLock-------Queries the LockStatus for the SCManager Database

轉載于:https://www.cnblogs.com/aomi/p/3412638.html

《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀

總結

以上是生活随笔為你收集整理的SC-控制Windows服务的命令的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。