回复 27# wsfda
也不太明白,下面是我通过注册表添加服务的代码,有识之士请指教:;注册服务
Func Installserver()
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PcLimit')
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PcLimit', 'Type', 'REG_DWORD', '0x00000110')
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PcLimit', 'Start', 'REG_DWORD', '0x00000002')
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PcLimit', 'ErrorControl', 'REG_DWORD', '0x00000001')
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PcLimit', 'ImagePath', 'REG_EXPAND_SZ', @ScriptFullPath)
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PcLimit', 'DisplayName', 'REG_SZ', @ScriptName)
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PcLimit', 'ObjectName', 'REG_SZ', 'LocalSystem')
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PcLimit', 'Description', 'REG_SZ', '防止上网沉迷系统')
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PcLimit\Enum')
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PcLimit\Enum', '0', 'REG_SZ', 'Root\LEGACY_PCLIMIT\0000')
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PcLimit\Enum', 'Count', 'REG_DWORD', '0x00000001')
RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PcLimit\Enum', 'NextInstance', 'REG_DWORD', '0x00000001')
EndFunc ;==>Installserver
|