Looking a one line of code is difficult at best and your question is very vague.
First you need to create a reference to the FileSystemObject.
Set fso = CreateObject("Scripting.FileSystemObject")Next you need a reference to the file.
Set objFile = fso.GetFile("now4.vbs") ' You can put a path on the file name
Your IF statement is in error. There is no
FileName property for the file object; use
objFile.NameNow it becomes problematic. If your are looking for the string
current within the file label you're not going to find it (in this case) but if you're looking in the files contents you can either read the entire contents of the file with the
ReadAll method or read the file line by line. The method for inserting a line in a sequential file is dependent on where the insertion point is... beginning of file, end of file or somewhere in the middle.
Good luck.