Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

Service Remover for Windows

 [1/1] from: ptretter::charter::net at: 25-May-2003 16:24

Clear DayHere is a script to uninstall services on Windows that may have been left behind from previous installations or that didn't install properly. Requires /Pro /Command or /SDK for windows NT platforms. REBOL [ Title: "Windows Service Remover" Author: "Paul Tretter" ] DEL: to-integer #{010000} SC_MANAGER_ALL_ACCESS: to-integer first reduce [ #{0000} or #{0001} or #{0002} or #{0004} or #{0008} or #{0010} or #{0020} ] remove-service: does [ winlib: load/library %advapi32.dll openscmanager: make routine! [ lpMachineName [integer!] lpDatabaseName [integer!] dwDesiredAccess [long] return: [integer!] ] winlib "OpenSCManagerA" openservice: make routine! [ hSCManager [integer!] lpServiceName [string!] dwDesiredAccess [integer!] return: [integer!] ] winlib "OpenServiceA" deleteservice: make routine! [ hService [integer!] return: [integer!] ] winlib "DeleteService" openscmanager-ret: openscmanager 0 0 SC_MANAGER_ALL_ACCESS openservice-ret: openservice openscmanager-ret service/text DEL deleteservice-ret: deleteservice openservice-ret either deleteservice-ret = 0 [ alert "Service could not be removed!" ][ alert "Service has been removed. Changes wont be visible until restart of computer" service/text: "" show service ] ] view layout [ backdrop forest vh3 "Windows Service Remover" across label "Enter Service to remove:" service: field return pad 50 btn "Remove" [either not empty? service/text [remove-service][alert "Please enter a Service Name"]] ]