Using this portion of script recommended in the forum:
----------------------
logfilespec="c:\vbs\file1.txt"
set ots=fso.opentextfile _
(logfilespec,8,false) 'forappending
if err.number<>0 then
wscript.echo "File is open. : err.clear
else
wscript.echo "File is not open."
ots.close
end if
-------------------------
err.number always returns 0, regardless of whether the file is open or not. I have opened the text file with various editors.
Is there a way to accurately test the text file's state?
Thanks
----------------------
logfilespec="c:\vbs\file1.txt"
set ots=fso.opentextfile _
(logfilespec,8,false) 'forappending
if err.number<>0 then
wscript.echo "File is open. : err.clear
else
wscript.echo "File is not open."
ots.close
end if
-------------------------
err.number always returns 0, regardless of whether the file is open or not. I have opened the text file with various editors.
Is there a way to accurately test the text file's state?
Thanks