When upgrading agent on Windows, the user gets 'Locked file detected for the selected agent'.
Workload Automation Agent: 12.0 or above
OS: Windows
Some exe in the Workload Automation Agent directory was running, or some file was being accessed by a process.
Make sure all the jobs have been completed. If there are any long running jobs, then make sure they have been completed / cancelled / killed from the manager side. Make sure any filemon / FW jobs have been stopped and no filewatcher process is running on the OS, check via Task Manager.
If all the jobs have been completed and agent has been stopped then check OS / security side to see if any external process is access agent directory. In some cases a restart of the OS may be required before doing the upgrade.
Use Procmon available as part of SysInternals, to see is any process had locks on agent directory