Click to See Complete Forum and Search --> : Why Script doesn't work when creat new ActiveXObject ?


cat
05-13-2003, 03:28 AM
My html file doesn't work with the javascript code

<script language="javascript">
var fso, f, r;
var ForReading = 1, ForWriting = 2;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.OpenTextFile("testfile.txt", ForWriting, true);
f.Close();
</script>

When I use IE to run my html file with this code, I always receipt the error message : Automation server can't create object.
What can I do ? Can you help me ?

IxxI
05-13-2003, 04:16 AM
Have you checked your IE Security settings (Tools - Internet Options - Security - Custom Settings) so that all the unsigned ActiveX control ones are set to prompt instead of disabled? Also what are you trying to write to it?

IxxI

IxxI
05-13-2003, 09:34 AM
I agree Dave, but if the ActiveX controls are changed to prompt instead of disabled, then the computer won't be open to attack, as to making others use the page in the same way, I was assuming that if cat was opening textfile.txt, without checking for its existance first then it had to be there, therefore its only for use on the hard drive...
Just nitpicking I know ;) ...

IxxI

cat
05-13-2003, 09:39 PM
Thank for your help. My mistake by IE Security Setting.
See you again.