[Tex/LaTex] Cannot start or run due to incompatibility with 64-bit version of Windows (Win 10 v2004)

miktexwindows

Recently, I upgraded my OS Win 10 64-bit from version v1903 to v2004. Then I failed to run the latex.exe through TexStudio (it worked well before the Win 10 upgrade). The error is shown as

"The program or feature
"??\C:….\MiKTex 2.9\miktex\bin\x64\pdflatex.exe" cannot start or run due to incompatibility with 64-bit versions of Windows. Please contact the software vendor to ask if a 64-bit Windows compatible version is available.
"

I tried to install the latex MiKTex (basic-miktex-20.6.29-x64) but an error "Windows API error 216." paused the installation. I also tried to uninstall the current MiKTex, but an error prompted "This app can't run on your PC. To find a version for your PC, check with the software publisher.".

Is there anyone know the solution for this issue? Thanks a lot.

Best Answer

After diving into this problem for a few hours, I found a solution by myself. Here are the steps:

  1. Install the latest MiKTex. Even I encountered the "Windows API error 216" error, the latest MiKTex is actually successfully installed.

  2. Open TexStudio, Go to "Options -> Configure TexStudio -> Commands", manually choose the the path of the latest MiKTex for Latex, PdfLatex (based on what kind of latex you use). Then TexStudio won't reach the incompatible pdfLatex.exe in the previous MiKTex 2.9 folder.

I guess my issue is 99% probability due to the OS upgrade but I am not sure. It is not usual to hit this issue because you need to install MiKTex 2.9 in previous Win 10 version and then have a system upgrade to a new version.

I saw some people viewed my question and I really appreciate your attention on my question. Thank you very much. Hopefully, this solution will help others who have the same issue as mine.