Documentation ¶
Index ¶
- Constants
- Variables
- func DisableDNSCache() error
- func EnableColorSupport() bool
- func EnableDNSCache() error
- func GetAllServiceNames() (map[int32]string, error)
- func GetServiceNames(pid int32) (string, error)
- func GetServiceStatus(name string) (status uint8, err error)
- func IsWindowsVersion(version string) bool
- func SartService(name string) (err error)
- func StopService(name string) (err error)
- func WindowsVersion() string
Constants ¶
const ( StatusUnknown uint8 = iota StatusRunningStoppable StatusRunningNotStoppable StatusStartPending StatusStopPending StatusStopped )
Service Status
Variables ¶
var (
ErrServiceNotFound = errors.New("no service with the given PID was found")
)
Errors
var (
ErrServiceNotStoppable = errors.New("the service is not stoppable")
)
Exported errors
Functions ¶
func DisableDNSCache ¶
func DisableDNSCache() error
DisableDNSCache disables the Windows Service "DNS Client" by setting the registry value "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Dnscache" to 4 (Disabled). A reboot is required for this setting to take effect.
func EnableColorSupport ¶
func EnableColorSupport() bool
EnableColorSupport tries to enable color support for cmd on windows and returns whether it is enabled.
func EnableDNSCache ¶
func EnableDNSCache() error
EnableDNSCache enables the Windows Service "DNS Client" by setting the registry value "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Dnscache" to 2 (Automatic). A reboot is required for this setting to take effect.
func GetAllServiceNames ¶
GetAllServiceNames returns a list of service names assosicated with svchost.exe processes on Windows.
func GetServiceNames ¶
GetServiceNames returns all service names assosicated with a svchost.exe process on Windows.
func GetServiceStatus ¶
GetServiceStatus returns the current status of a Windows Service (limited implementation).
func IsWindowsVersion ¶
IsWindowsVersion returns whether the given version matches (HasPrefix) the current Windows version.
func WindowsVersion ¶
func WindowsVersion() string
WindowsVersion returns the current Windows version.
Types ¶
This section is empty.