5

Tiêu điểm của tôi là trên máy chủ web.Cách thay đổi loại khởi động của dịch vụ cửa sổ bằng dòng lệnh

Máy chủ web Apache không cài đặt dịch vụ theo kiểu tự động (httpd -k install) và Apache không cung cấp thông số để cài đặt dịch vụ theo loại thủ công (như MySQL:).

Tôi đọc một số khoảng SC (C:\Windows\System32\sc.exe) và cố gắng thay đổi bằng SC nhưng tôi không thể. Vậy giải pháp là gì?

Trả lời

12

SC sẽ có thể xử lý việc này, bạn có gặp phải bất kỳ lỗi nào không?

này sẽ thiết lập kiểu khởi động để hướng dẫn cho một dịch vụ gọi là 'apache':

SC \\computername CONFIG apache start= demand 
+2

Có hoạt động. Sai lầm của tôi là trên một phần _start = demand_ mà tôi đã không đặt một không gian sau khi dấu bằng. Cảm ơn. – Mamadex

0

tôi chỉ áp dụng cùng một mục đích --CHANGE WIN DỊCH VỤ STARTUP METHOD-- trên một máy từ xa ..

C:\MrCMD> REG QUERY \\RemoteHostName\HKLM\SYSTEM\CurrentControlSet\Services\WUAUServ 

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WUAUServ 
    Type REG_DWORD 0x20 
    Start REG_DWORD 0x2 
    ErrorControl REG_DWORD 0x1 
    ImagePath REG_EXPAND_SZ %systemroot%\system32\svchost.exe -k netsvcs 
    DisplayName REG_SZ Automatic Updates 
    ObjectName REG_SZ LocalSystem 
    Description REG_SZ Enables the download and installation of Windows updates. If this service is disabled, this computer will not be able to use the Automatic Updates feature or the Windows Update Web site. 

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WUAUServ\Parameters 
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WUAUServ\Security 
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WUAUServ\Enum 

┌─────────────────────────────────────┐ 
│ Executed Mon 01/14/2013 14:27:15.31 │ As [MrCMD] 
└─────────────────────────────────────┘ 

C:\MrCMD> REG ADD \\RemoteHostName\HKLM\SYSTEM\CurrentControlSet\Services\wuauserv /V Start /T REG_DWORD /d 0x3 
Value Start exists, overwrite(Yes/No)? y 
The operation completed successfully. 

┌─────────────────────────────────────┐ 
│ Executed Mon 01/14/2013 14:29:57.72 │ As [MrCMD] 
└─────────────────────────────────────┘ 

C:\MrCMD> REG QUERY \\RemoteHostName\HKLM\SYSTEM\CurrentControlSet\Services\WUAUServ 

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WUAUServ 
    Type REG_DWORD 0x20 
    Start REG_DWORD 0x3 
    ErrorControl REG_DWORD 0x1 
    ImagePath REG_EXPAND_SZ %systemroot%\system32\svchost.exe -k netsvcs 
    DisplayName REG_SZ Automatic Updates 
    ObjectName REG_SZ LocalSystem 
    Description REG_SZ Enables the download and installation of Windows updates. If this service is disabled, this computer will not be able to use the Automatic Updates feature or the Windows Update Web site. 

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WUAUServ\Parameters 
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WUAUServ\Security 
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WUAUServ\Enum 

┌─────────────────────────────────────┐ 
│ Executed Mon 01/14/2013 14:30:37.80 │ As [MrCMD] 
└─────────────────────────────────────┘ 

Đó là tất cả mọi người .. :)