I encountered the following error while attempting to download and install the package ctex via the MikTex Console.

Permission denied: path="C:\Program Files\MikTeX 2.9\tex/generic/ctex/zhmap", modeString="wb"

This is the info I obtained from the consoles error log via the 'Copy Info' Button.

GENERAL MIKTEX INFORMATION ReportDate: 2021-03-20 19:37:33

CurrentVersion: 21.3

SetupDate: 2018-04-26 20:38:00

SetupVersion: 2.9

Configuration: Regular

GitInfo: ab8ebca / 2021-03-19 10:22:46

OS: Windows 10 Home, 64-bit, build 19042

SharedSetup: no

LinkTargetDirectory: C:\Program Files\MikTeX 2.9\miktex\bin\x64

PathOkay: yes

SystemAdmin: yes

RootPrivileges: yes

AdminMode: no

Root0: C:\Users\Admin\AppData\Roaming\MiKTeX\2.9

Root1: C:\Users\Admin\AppData\Local\MiKTeX\2.9

Root2: C:\Program Files\MikTeX 2.9

Root3: C:\ProgramData\MiKTeX\2.9

UserInstall: C:\Program Files\MikTeX 2.9

UserConfig: C:\Users\Admin\AppData\Roaming\MiKTeX\2.9

UserData: C:\Users\Admin\AppData\Local\MiKTeX\2.9

CommonInstall: C:\Program Files\MikTeX 2.9

CommonConfig: C:\ProgramData\MiKTeX\2.9

CommonData: C:\ProgramData\MiKTeX\2.9

Invokers: non-existing/explorer


Program: C:\Program Files\MikTeX 2.9\miktex\bin\x64\miktex-console.exe

Source: Libraries\MiKTeX\Core\File\win\winFile.cpp:567

Error: Permission denied: path="C:\Program Files\MikTeX 2.9\tex/generic/ctex/zhmap", modeString="wb"


path: C:\Program Files\MikTeX 2.9\tex/generic/ctex/zhmap

modeString: wb

I have made sure that MikTex Console runs in Administrator mode, yet I keep getting the error above. Is there a way to resolve this issue without having to reinstall MikTex from scratch?

  • The latest version of ctex has an error. What should be a folder zhmap has been mis-written as a file. I have asked about this is question tex.stackexchange.com/questions/588319/… but got no answer. I think we just have to wait for them to repair the ctex package. Commented Mar 22, 2021 at 4:24
  • 1
    @ColinMcLarty sitting there and waiting doesn't resolve problems. You have to do something. I now added an issue github.com/MiKTeX/miktex-packaging/issues/236, but I wished people using this packages would do this themselves. Commented Mar 22, 2021 at 9:51
  • @UlrikeFischer Confluentius reported it 2 days ago github.com/MiKTeX/miktex/issues/756 so I did not know another report would be needed. For now, apparently there is no patch users can apply, and we must wait for a correcting update. Commented Mar 22, 2021 at 14:29

1 Answer 1


The ctex package has been repaired. I just re-installed it and it works for me.

This error message was due to an error in the March 21 version of ctex. You actually should not have permission to modify zhmap the way that version wanted to. Rather zhmap has to be a folder rather than a file in ctex. There was apparently nothing you (or I who share the problem) could do overcome that. The issue has been fixed now.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .