When trying to upgrade agent on Windows 2008 R2 , the following error message is been received despite the Agent being stopped and no jobs running on the Agent server:
" The target : <agent_install_path>\cybAgent.exe is not writeable file. Terminating patching (java.io.FileNotFoundException: <agent_install_path>\cybAgent.exe (The process cannot access the file because it is being used by another process))
Update failed".
This seems to be a bug on windows 2008 machines:
http://stackoverflow.com/questions/4378192/windows-2008-r2-kernel-system-process-pid-4-is-locking-files-and-folders
To overcome this issue and upgrade the Agent on your windows 2008 R2 server, enable the "Application Experience" Windows service and run the installation again.