@igor At first I didn't get any notification from Avast, and TeX only gave me a general error "can't write on file" (which is why it took me two days to figure out it was Avast's fault). However this morning for the first time Avast asked me if I wanted to continue blocking pdflatex.exe from accessing a protected folder, and by saying No the problem solved itself, so thanks anyway
And @Asyn, I checked and that is what I should have done if Avast hadn't notified me, so thank you as well!