# Miktex on windows 8: fatal format file error

I've just freshly installed miktex 2.9 on windows 8. Plain tex seems to work but running latex on a simple file produces

This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9)
(Fatal format file error; I'm stymied)

Searching for this error suggests that I should regenerate format files via miktex's options program, which I have done. Indeed I observe that miktex options->update formats touches the files latex.fmt and pdflatex.fmt (and others) in the following directory:

C:\Users\Jenny\AppData\Local\MiKTeX\2.9\miktex\data\le\pdftex

However the error still occurs. (I also tried miktex options->format->build, which seems to do the same thing but one file at a time).

I'm not sure how to verify that latex is looking in the right place for these files. In miktex options->roots I see the path C:\Users\Jenny\AppData\Local\MiKTeX\2.9 with description "UserInstall, UserConfig". However I can't see any environment variables pointing to this directory. Following this answer I tried defining

TEXMFCACHE=C:\Users\Jenny\AppData\Local\MiKTeX\2.9

to no avail. I also tried copying the .fmt files to both of these directories:

C:\Users\Jenny\AppData\Roaming\MiKTeX\2.9\miktex\data\le\pdftex
C:\ProgramData\MiKTeX\2.9\miktex\data\le\pdftex
-
Welcome to TeX.SX! – Adam Liter Jul 20 '14 at 6:53
I see two possible reasons: either you had another version of MiKTeX already installed (I doubt that on a Windows 8 system) or some files got corrupted at installation, and you should uninstall and re-install. I never had to set environment variables myself on a MiKTeX system. – Bernard Jul 20 '14 at 8:49
Don't copy files around. Remove the fmt-files you have placed everywhere. They only can confuse the search order. Open a command line in the folder of your test file and check the location of the format file with kpsewhich --engine=pdftex pdflatex.fmt. Then go to miktex settings (user mode), tab format, select the pdflatex entry and click on build. Do you get an error? Does this recreate the fmt you found with kpsewhich? – Ulrike Fischer Jul 20 '14 at 10:12
I did also try reinstalling. kpsewhich points to C:/Users/Jenny/AppData/Local/MiKTeX/2.9/miktex/data/le/pdftex/pdflatex.fmt which is recreated without error from the format tab. – stewbasic Jul 21 '14 at 0:01
The "Fatal format file error" normally happens when the format file has not been created by same pdftex that is trying to use it. I can e.g. force it by creating a format in the current folder with texlive and then trying to compile with miktex. So check very carefully if there are other pdflatex.fmt around. Check also if your editor points to some other pdflatex executable. Check with "set" your environment variables. – Ulrike Fischer Jul 21 '14 at 9:36