{$A+,B-,C-,E-,F-,G+,H+,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}
{$APPTYPE CONSOLE}
program removedriver;

uses
  windows, winsvc;

var
  OSInfo      : TOSVersionInfo;
  ServiceStat : TServiceStatus;
  HService,
  HSCManager  : SC_Handle;

begin
  OSInfo.dwOSVersionInfoSize := sizeof(OSInfo);
  if GetVersionEx(OSInfo) then
  begin
    if OSInfo.dwPlatformId = VER_PLATFORM_WIN32_NT then
    begin
      HSCManager := OpenSCManager(nil, nil, SC_MANAGER_ALL_ACCESS);
      if HSCManager <> 0 then
      begin
        HService := OpenService(HSCManager, 'EXPRO', SERVICE_ALL_ACCESS);
        if HService <> 0 then
        begin
          ControlService(HService, SERVICE_CONTROL_STOP, ServiceStat);
          DeleteService(HService);
          CloseServiceHandle(HService);
        end;
        CloseServiceHandle(HSCManager);
      end;
    end;
  end;
end.
