07-24-2023, 07:04 AM
I have several JavaScript files that when run return no errors, but do not do what is coded inside them. This is one of them. Is there something else I should have installed or enabled on the PC running the .JS files?
function WriteDemo()
{
var fso, f, r;
var ForReading = 1, ForWriting = 2;
fso = CreateObject("Scripting.FileSystemObject");
f = fso.OpenTextFile("c:\\testfile.txt", ForWriting, true);
f.Write("Hello world!");
f.Close();
f = fso.OpenTextFile("c:\\testfile.txt", ForReading);
r = f.ReadLine();
return®;
}
function WriteDemo()
{
var fso, f, r;
var ForReading = 1, ForWriting = 2;
fso = CreateObject("Scripting.FileSystemObject");
f = fso.OpenTextFile("c:\\testfile.txt", ForWriting, true);
f.Write("Hello world!");
f.Close();
f = fso.OpenTextFile("c:\\testfile.txt", ForReading);
r = f.ReadLine();
return®;
}