I have TexLive on Windows 10 installed. For some reason, it can only write to files in certain folders, and not others.
I am using the command: pdflatex sample2e.tex
This uses a sample document that comes with TexLive for testing. The file can be found here: http://www.wikiupload.com/UFRD0WK19701I6J

I get the following output in these folders (i.e. it works): C:\Users\josh_,C:\Users\josh_\testing, C:\testing

This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/W32TeX) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2017-04-15>
Babel <3.13> and hyphenation patterns for 84 language(s) loaded.
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(c:/texlive/2016/texmf-dist/tex/latex/base/size10.clo)) (./sample2e.aux)
(c:/texlive/2016/texmf-dist/tex/latex/base/omscmr.fd) [1{c:/texlive/2016/texmf-
var/fonts/map/pdftex/updmap/pdftex.map}] [2] [3] (./sample2e.aux) )<c:/texlive/
Output written on sample2e.pdf (3 pages, 136743 bytes).
Transcript written on sample2e.log.

However, I get the following output in these folders (i.e. it doesn't work): C:\Users\josh_\Documents\tester, C:\Users\josh_\Documents, C:\Users\josh_\Dropbox, C:\Users\josh_\Dropbox\tester, C:\Users\josh_\Desktop, C:\Users\josh_\Desktop\testing

This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/W32TeX) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
! I can't write on file `sample2e.log'.
(Press Enter to retry, or Control-Z to exit; default file extension is `.log')
Please type another transcript file name:

Can you tell me what is going on and how to fix it?

I particularly want to work in my Dropbox folders.


  • 1
    Added the file. Yes, I can write to the folders where I get the error message. I am the sole administrator and I only have one account on the computer. I can't get rid of the _. Windows, in all its wisdom, gave "josh_" as the folder name when I first set up the computer. It is rather ridiculous. To clarify, I first cd into the folder and then run the command. Commented Sep 26, 2017 at 21:32
  • is there an existing sample2e.log there? Commented Sep 26, 2017 at 23:08
  • 1
    @DavidCarlisle Isn't there a known issue with Dropbox?
    – cfr
    Commented Sep 26, 2017 at 23:35
  • @cfr perhaps: tex.stackexchange.com/questions/336541/… Commented Sep 26, 2017 at 23:38
  • 2
    TeXlive doesn't update/upgrade a 2016 to 2017. I have both and they are in parallel folder. Perhaps you installed the 2017 over the 2016. That's curious but I doubt that is the reason of the blocked folders. Do you have some antivirus or firewall system or something like that tries to protect the folders? Commented Sep 27, 2017 at 18:09

2 Answers 2


My antivirus/firewall program Bitdefender Total Security 2018 has the above "failed" folders protected. Upon opening the program it gave notifications that it had blocked pdflatex from writing to certain protected folders.

I then told Bitdefender to allow pdflatex to write to protected folders by doing the following:
1. Open Bitdefender.
2. Go to the main screen (icon is a "B" inside a shield).
3. Click on View Features.
4. Click on Application Access in the Safe Files box at the bottom right of the interface.
5. The blocked program(s) will be listed as "blocked". Click the toggle switch to set them to "allowed".

After this, pdflatex could write to the "failed" folders listed above.

Thanks to everyone for your help! A big thank you to Ulrike Fischer for the key insight of looking for a program that is protecting the folders!


I just bought a laptop with Windows 10 and installed TeXlive.2021.


  • cannot run texhash.exe from icon nor batch file

    • solution: navigate to C:...\texlive\2021\bin\win32 select texhash.exe, run as Administrator

alternate: edit the various files C:/.../texlive/texmf-local/ls-R to write. C:/.../texlive/2021/texmf-config/ls-R to write. C:/.../texlive/2021/texmf-var/ls-R to write. C:/.../texlive/2021/texmf-dist/ls-R to write.

  • cannot write .log

solution: turn on access to controlled folders:


Controlled folder access in Windows Security reviews the apps that can make changes to files in protected folders and blocks unauthorized or unsafe apps from accessing or changing files in those folders.

Select Start

Settings Update & Security > Windows Security > Virus & threat protection.

Under Virus & threat protection settings, select Manage settings.

Under Controlled folder access, select Manage Controlled folder access.

Switch the Controlled folder access setting to On or Off.

Ron Fehd

You must log in to answer this question.

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