Sedikit lebih dalam dengan perintah 'SC', kami dapat mengekstrak semua 'Nama Layanan' dan mendapatkan semua 'QueryServiceConfig' :)
>SC QUERY > "%computername%-services.txt" [enter]
>FIND "SERVICE_NAME: " "%computername%-services.txt" /i > "%computername%-services-name.txt" [enter]
>NOTEPAD2 "%computername%-services-name.txt" [enter]
Lakukan pengeditan NOTEPAD2 'kecil' ..
Kemudian, lanjutkan dengan 'CMD' ..
>FOR /F "DELIMS= SKIP=2" %S IN ('TYPE "%computername%-services-name.txt"') DO @SC QC "%S" >> "%computername%-services-list-config.txt" [enter]
>NOTEPAD2 "%computername%-services-list-config.txt" [enter]
Data mentah siap untuk memberi makan 'file batch masa depan' sehingga hasilnya terlihat seperti ini di bawah ini !!!
+ -------------+-------------------------+---------------------------+---------------+--------------------------------------------------+------------------+-----+----------------+--------------+--------------------+
| SERVICE_NAME | TYPE | START_TYPE | ERROR_CONTROL | BINARY_PATH_NAME | LOAD_ORDER_GROUP | TAG | DISPLAY_NAME | DEPENDENCIES | SERVICE_START_NAME |
+ -------------+-------------------------+---------------------------+---------------+--------------------------------------------------+------------------+-----+----------------+--------------+--------------------+
+ WSearch | 10 WIN32_OWN_PROCESS | 2 AUTO_START (DELAYED) | 1 NORMAL | C:\Windows\system32\SearchIndexer.exe /Embedding | none | 0 | Windows Search | RPCSS | LocalSystem |
+ wuauserv | 20 WIN32_SHARE_PROCESS | 2 AUTO_START (DELAYED) | 1 NORMAL | C:\Windows\system32\svchost.exe -k netsvcs | none | 0 | Windows Update | rpcss | LocalSystem |
Tapi, HTML akan lebih mudah: D
Setiap ide cemerlang untuk perbaikan dipersilakan V ^ _ ^
sc config mssqlserver binPath= "\"F:\SQL DATA\MSSQL10.MSSQLSERVER\MSSQL\Binn\sqlservr.exe\" -sMSSQLSERVER"