The character codes for that are vbcr and vblf (also vbcrlf) which translate to chr(13) and chr(10) (those are carriage return and line feed). So, if it would be easier for you to merely check for an occurance of either of those in a string using instr, and replacing the offending character with the replace function, that might be an easier solution for you. However, if you want to leave the file completely unchanged, and merely write the file as it is with binary:
Dim B() As Byte
Dim srcFile as string
dim destFile as string
' /* Change This To your File */
srcFile = "c:\somefile.exe"
destFile = "c:\destination.exe"
Open srcFile For Binary Access Read As #1
ReDim B(LOF(1) - 1)
Get #1, , B
Close #1
open destfile for binary access write as #1
put #1, , B
close #1
Let me know what you come up with.
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Offline 2,413 posts
since Dec 2004