Re: Edit a Binary File?



"DiGiTAL SKReAM" wrote in message news:u1$45fuuFHA.596@xxxxxxxxxxxxxxxxxxxx
> Hey folks!
> i am working on a project wherein I need to automate the process of
> modifying a ntbackup job file (job.bks). Apparently, the file is in
> Binary, although it only seems to have text data.
> I need to do a Replace() on teh server name that is stored in the file.
> However, when I do so, whether it is via .ReadLine/.WriteLine or
> ReadAll/.Write, the resulting file does not ever have the text
> replaced, and always ends up with extra characters at the end. And when
> I try to wscript.echo the contents of the file, VBS returns a few
> high-ascii characters, and that's it.

Are you opening the "job.bks" as unicode text?

ex.
Set aFile = objFSO.OpenTextFile("job.bks", ForReading, False, True)

See this kb article.
"Scheduled backup jobs may not run as expected"
http://support.microsoft.com/?kbid=264604&ln=en

--
Miyahn (Masataka Miyashita) JPN
Microsoft MVP for Microsoft Office - Excel(Jan 2005 - Dec 2005)
HQF03250@xxxxxxxxxxx

.