MID server upgrade fails due to: [wmi_collector.exe cannot be deleted .... cannot access the file because it is being used by another process]



During a MID Server Upgrade try, the Wrapper.log contains these messages, resulting in a failed MID Server upgrade attempt

... com.snc.dist.mid_upgrade.UpgradeMain missingOrCanDelete 
INFO | jvm 1 | <date/time stamp | INFO: <MID Server agent install path>\bin\sw_wmi\bin\wmi_collector.exe cannot be deleted: <MID Server agent install path>\bin\wmi_collector.exe (The process cannot access the file because it is being used by another process) 


Prior to  London Patch 4 Hotfix 2


Windows Servers hosting a MID Server and has installed "ServiceNow WMI Collector" service


wmi_collector.exe is locked.

During an upgrade attempt the message may be due to the following:

  1. The process is hung for one reason or another and cannot be terminated by "Windows taskkill /F /PID <pid>" or through Task Manager "Kill Process Tree", or through Windows Services control panel
  2. wmi_collector listens on port 8585. If this port is already taken by another non-ServiceNow application but the ServiceNow wmi_collector repeatedly tries to bind and re-bind to this port every 30 seconds. For this it may possible to get the executable by running "netstat -aob | findstr 8585" and confirm if the non-ServiceNow process can be terminated.



  1. Set the service startup option to "Disabled".
  2. Reboot the host system,
  3. Change the startup option to "Automatic" after upgrade completes then stop/start (or restart) the mid server service.

Important note

WMI Collector is deprecated in New York patch 10 and later. See the KB0791835 WMI Collector deprecation details for more information.