I have a scenario in my testing where I have to open a XML file in notepad , update the latest time + 10 minutes and save it. I am running into errors here for reading the file. I know the updating string part works as I already tested that in a separate sub (). Issue is how to get to the part of readiing the opened file and save the changes.
sub OpenFile
strFileName = "C:\mytestfile.xml"
Set oShell = CreateObject("WScript.Shell")
oShell.Run "notepad " & strFileName
While Not strFileName.IsEndOfFile()
s = strFileName.ReadLine()
str = "cronExpression"" value=""0 18 28"
if instr(s,str)<>0 then
Set re = New RegExp
re.Pattern = "[0-9][0-9] [0-9][0-9]"
re.global = true
mh=hour(now)
mm = minute(now)+15
if mm>59 then
mh = mh+1
mm = 10
end if
a = cstr(mh)+" "+cstr(mm)
str = re.Replace(str, cstr(a) )
Log.Message( str)
else
log.Message xxx
end if
WEnd
end sub
Thanks