Please help me write a VBScript to insert a Byte Order Marker (BOM) into a text string/file.
Thanks.
BOM
-
- Administrator
- Posts: 78549
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: BOM
Try code like this - a BOM should be written at the beginning of the file automatically because the 3rd argument to CreateTextFile is True (specifying Unicode):
If that does not do what you want please provide more information about what you want to accomplish.
Code: Select all
Dim fso
Dim tf
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.CreateTextFile("C:\MyFiles\Test.txt", True, True)
tf.WriteLine "Hello World"
tf.Close
Best wishes,
Hans
Hans