[Tex/LaTex] TeXstudio + MikTex: “Error: Command crashed: pdflatex.exe”

errorsmiktexpdftextexstudio

I'm running Win10, MikTex 2.9, and TeXstudio. I tried to update my packages yesterday, and I think the update was interrupted by the computer going to sleep. Although all of the packages appear to be up-to-date (and MikTex Console says "no updates"), it also appears to have corrupted something in my installation. Any suggestions for repair other than full uninstall/reinstall of MikTeX?

MWE:

\documentclass{article}
\begin{document}
Hello world
\end{document}

TeXstudio Messages:

Process started: pdflatex.exe -synctex=1 -interaction=nonstopmode "temp".tex

Error: Command crashed: pdflatex.exe -synctex=1 -interaction=nonstopmode "temp".tex

Process exited with error(s)

I downloaded and installed the latest version of TeXstudio (2.12.22) and then got this error pop-up when I open TeXstudio and when I try to compile:
Error dialog: pdflatex.exe - Entry Point Not Found

Added 5pm:

Running both "pdflatex temp.tex" and "texify temp.tex" from the command line produced the same result:

C:\Temp>texify temp.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 2.9.7300 64-bit)
_

And it simply sits there running. I found a process named "Make a TeX .fmt file" in the Task Manager, and then tracked down this in the miktex-makefmt.log file:

2020-03-20 16:42:32,481-0500 INFO  miktex-makefmt - starting with command line: miktex-makefmt.exe --engine=pdftex --dest-name=latex --no-dump latex.ini --engine-option=-tcx=cp227.tcx --miktex-disable-maintenance --miktex-disable-diagnose
2020-03-20 16:42:32,491-0500 INFO  makefmt - found input file: C:\Users\<name>\AppData\Local\Programs\MiKTeX 2.9\tex\latex\00miktex\latex.ini
2020-03-20 16:42:32,491-0500 INFO  makefmt - Creating the latex format file...
2020-03-20 16:42:32,511-0500 INFO  makefmt - Running miktex-pdftex.exe...
2020-03-20 16:42:32,511-0500 INFO  makefmt - running: miktex-pdftex.exe --miktex-disable-maintenance --miktex-disable-diagnose --initialize --interaction=nonstopmode --halt-on-error --alias=latex --job-name=latex -tcx=cp227.tcx --enable-etex latex.ini
2020-03-20 16:45:10,847-0500 FATAL miktex-makefmt - miktex-pdftex.exe failed on latex.ini.
2020-03-20 16:45:10,847-0500 FATAL miktex-makefmt - miktex-pdftex.exe failed on latex.ini.
2020-03-20 16:45:10,847-0500 FATAL miktex-makefmt - Info: 
2020-03-20 16:45:10,847-0500 FATAL miktex-makefmt - Source: 
2020-03-20 16:45:10,847-0500 FATAL miktex-makefmt - Line: 0

Added 6pm:
After running

miktex-pdftex --initialize --enable-etex pdflatex.ini

I get:

("C:\Users\<name>\AppData\Local\Programs\MiKTeX 2.9\tex/generic/dehyph\dehyph
t.tex"
German Traditional Hyphenation Patterns `dehypht' Version 3.2a <1999/03/03>
(Formerly known under the name `ghyph31' and `ghyphen'.)))
! I can't find file `dehypht-x-2018-03-31.tex'.

Best Answer

Thanks to @UlrikeFischer, the solution was to run the following from the command line:

initexmf --force --mklinks
initexmf --mklangs

Notes:

  • The first line may not have been necessary in my case.
  • I installed MiKTeX as "personal" or "single user". If it had been "for everyone" or "system-wide," then I would have needed to add --admin to the end of these commands. See https://docs.miktex.org/manual/initexmf.html