set hr=%time:~0,2%
if "%hr:~0,1%" equ " " set hr=0%hr:~1,1%
set myFilesuffix=%date:~-4,4%%date:~-7,2%%date:~-10,2%_%hr%%time:~3,2%%time:~6,2%
echo %myFilesuffix%
pause
 
Call WriteUTF8WithBOM(sometext, afile, true)
Public Function WriteUTF8WithBOM(mytext As Variant, myfullfilename As String, myappend As Boolean) Dim fsT As Object Set fsT = CreateObject("ADODB.Stream") fsT.Type = 2 'Specify stream type - we want To save text/string data. fsT.Charset = "utf-8" 'Specify charset For the source text data. fsT.Open 'Open the stream And write binary data To the object If myappend Then myx = "" fsT.LoadFromFile (myfullfilename) myx = fsT.ReadText(-1) 'mytext = myx & mytext End If fsT.WriteText mytext fsT.SaveToFile myfullfilename, adSaveCreateOverWrite 'fsT.SaveToFile sFileName, 2 'Save binary data To disk End FunctionDon't forget to add ActiveX Data Objects