Search code examples
windowsbatch-filetextexe

how could I run/execute a text file as a exe using batch


I need to know how I could make a batch file that would execute / run a txt file as if it was an exe file. Does any one know what I could do or try. I am using windows 7 ultimate 32 bit. The txt file is an exe just with the .txt extension.


Solution

  • If it is an EXE, why is it named .txt?

    Sometimes EXEs are renamed to be able to send them per EMail (some Email-servers are blocking EXEs for security reasons)

    Best way is to rename it to .exe

    If you really want to stay it as .txt make a copy:

    copy file.txt file.exe
    file.exe
    

    Note: Don't run any executable if you don't fully trust the source!