After an apparently mandatory Windows update screwed up my PATH variables and Controlled Folder Access, I took great pains to reconfigure (and even reinstall) MikTeX 2.9 so that the usual routines such as latex and pdflatex are finally working properly again. But when I try to use latexdiff in Command Prompt with admin privileges, e.g.,

D:\Documents\manuscript>latexdiff.pl draft1.tex draft2.tex > draft2_diff.tex

The following error message shows up:

The system cannot find the file specified.

Now, if I manually create the file draft2_diff.tex in that same folder, i.e., D:\Documents\manuscript, latexdiff does run, but does not write into or change in any way the file draft2_diff.tex.

I have tried many things and it still didn't work. I've made sure that

C:\Program Files\MiKTeX 2.9\miktex\bin\x64
C:\Program Files\MiKTeX 2.9\scripts\latexdiff\perl

are already in my system PATH (in fact I followed this to copy the latexdiff scripts into the subfolder perl, and added the file extensions *.pl). I also went to Windows Security Center > Allow an app through Controlled Folder Access to add all the major MikTeX and latexdiff routines into the white list (which was part of what screwed up my TeXMaker and latex compilation before I managed to fix it). I'm running out of clues so I'm here to ask.


  • you should double check which one and how many perls are active on the path so use where /r c:\ perl ... IF it lists 2 then sort out if the first one is the first location you see when you simply type> path if its not there then you need to sort that out
    – user170109
    Feb 25, 2019 at 1:56
  • Here's what I found -- see added image above. How should I proceed?
    – Charles
    Feb 25, 2019 at 10:08
  • That long path won't help with multiple identical entries , difficult to know where best to do the culling, some entries will be system wide some personal some runtime if you are using a script at start-up First thing that strikes me is it found 3x perl.exe and has listed what seems alphabetic order but you have identical bin locations in path so was expecting those to be reported more than once, anyway looks like you have potential hick-up of a hanging ; at end of path; so may first be worth finding where that entry is and remove it along with duplicate ;c:\strawberry\perl\bin; avoid extra ;
    – user170109
    Feb 25, 2019 at 10:49


You must log in to answer this question.

Browse other questions tagged .