Well, the magic is here:
 Code:
shell '%comspec% /c type "original file path" > "new file path"'

That opens the original file and redirects it to a new file, which defaults to ANSI format - a neat trick. That's really the only thing you need for your process, as it opens the original and writes to a copy - just modify your script to open the copy you created, and then delete it when you are done.

Note that I changed the ">>" to ">", since you don't want to append to any existing file. Just properly define the "original file path" and "new file path" values.

The rest of the code you found is unnecessary - you already have the open/read logic.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D