It's not about running code, it's about opening a TXT file with the operating system default handler for TXT files.
So you what you are saying is basically 'do not open any files or websites you don't trust' - which is usually not what people expect as that would basically mean 'don't use your computer'