-1

I'm using freepascal. So after I run my code compiler creates an exe file that should create few text files. However after it creates an exe file it says "Program c:\fpc\2.6.4\bin\i386-win32\maxmin.exe exited with exitcode = 2". No text files are created. If I later run maxmin.exe manually - it works fine.

UAC - disabled and EnableLUA = 0. But I still pretty sure - it is windows 8.1 rights issue problem.

1 Answers1

0

Some possibilities, in descending order of likeliness:

Note that exitcode 2 usually indicates a file not found error.

  1. Working directory. While manually executing you set the working directory by CDing with the shell, and when indirectly executing the program's assumptions about a working directory are not satisfied.

  2. Sometimes locks linger on Windows for a short while. Usually not noticeable in the manual execution time frames, but when programmatically executing programs in quick succession it might happen.

  3. If you have the feeling that the EXE doesn't run at all, it might be an security software issue. After the binary is generated, the antivirus kicks in and wants to scan, locking the binary for a few seconds.

Marco van de Voort
  • 25,628
  • 5
  • 56
  • 89