Should I use "the" before file names?

As with other names, we only use "the" when we are picking out one of several items with the same name, nearly always with some identifying words (eg "The Lincolnshire Boston" or "The Muhammad Ali who was viceroy of Egypt). Otherwise "the" is ungrammatical before a name.

So "The config.txt that was created in the previous step" would be fine, but without such a defining phrase, just "config.txt".

What might mislead you is that we can use a name in apposition to a definite noun phrase: "the file config.txt" is fine.