To save it to a new text file you may want to use following VBScript for your needs.
Dim HTM, wWidth, wHeight
Set HTM = CreateObject("htmlfile")
wWidth = HTM.parentWindow.screen.Width
wHeight = HTM.parentWindow.screen.Height
wscript.echo wWidth & "X" & wHeight
Set objFileToWrite = CreateObject("Scripting.FileSystemObject").OpenTextFile("D:\file.txt",2,true)
objFileToWrite.WriteLine("--- screen resolution start -------------------------")
objFileToWrite.WriteLine( wWidth & "X" & wHeight)
objFileToWrite.WriteLine("--- screen resolution end -------------------------")
objFileToWrite.Close
Set objFileToWrite = Nothing
If you want to append text to the end of an existing text file you can easily change the IOMode parameter to 8 e.g.
("D:\file.txt",8,true)
The true parameter makes sure that the file is newly created or must already exist if false.