Clicking a disabled button problem

I want to disregard clicks on a disabled button. This is a button that is initially enabled and after being clicked becomes disabled. Once the procedure is concluded (renaming and transferring a file) the button is again enabled. The problem is that if the disabled button is clicked on, when it becomes enabled again, the procedure starts again immediately on the next file. I would like the disabled button to not ‘save’ any clicks which would activate it when it becomes enabled again. I want the user to interact with application first and then be able to click the button after that. Thanks for any help.