Safety of opening .txt files

John picture John · Oct 19, 2012 · Viewed 11.6k times · Source

If I'm given a URL that points to a .txt file, is it always safe to open it? Can it possibly contain virus or malicious content?

Answer

user1544165 picture user1544165 · Oct 19, 2012

A genuine txt-file can contain virus code but it cannot be executed, so it's totally safe. However, a file can use double file extension like this, so watch out:

a-virus-file.txt.exe

Windows hides by default .exe because it's a known file type.