0

While compiling or building a Delphi project in XE7, most of the members in my team get below error.

[Exec Error] The specified task executable could not be run. The process cannot access the file 'C:\Users\bond\AppData\Local\Temp\tmpE277.tmp.Exec.bat' because it is being used by another process.

On the next run, one would get an error with a different tmpXXXX.tmp.Exec.bat file.

The problem here is if we try to compile build again, it might be successful.

BUT most of the time, we would have to do try this at least 5 to 6 times.

AND sometimes, the error keeps on coming no matter how many times we try.

Could someone help solve the issue?

3
  • 1
    Likely your anti virus scanner is to blame. Disable it for this folder to test that theory. Commented Jun 8, 2018 at 7:04
  • When the error happens, try using SysInternals Process Explorer to see which process(es) are accessing the file. Commented Jun 8, 2018 at 8:26
  • Will check with ProcessExplorer if disabling Anti-Virus did not work. Thank you. Commented Jun 8, 2018 at 11:04

1 Answer 1

1

One workaround which works 100% is to keep your CPU very busy. I run this particular query in 3 separate threads in SQL Server.

DECLARE @T DATETIME, @F BIGINT;
SET @T = GETDATE();
WHILE DATEADD(SECOND,120,@T)>GETDATE()
SET @F=POWER(2,30);

The power of 2 to 30 is a CPU heavy function and running it in 3 threads makes my CPU cross 90%. And building the Delphi project when the CPU is very busy somehow overcomes the tmpXXX.tmp.Exec.bat is being used issue.

I do not know why, may be the antivirus which locks the Temp folder doesn't get enough CPU. But anyway this works all the time

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.