Re: Printing Scipt not working in Windows XP by Bob
Bob
Thu May 08 06:12:36 CDT 2008
Ramesh Singh wrote:
> IN Windows 98 below script was running fine
> <SCRIPT ID=clientEventHandlersVB LANGUAGE=vbscript>
> <!--
> function button1_onclick()
> Const ForReading = 1, ForWriting = 2, ForAppending = 8
> Dim fso, f,a
> Set fso = CreateObject("Scripting.FileSystemObject")
> Set f = fso.OpenTextFile("c:\testfile.txt", ForWriting, True)
> f.Write txtout.value & vbcrlf
> f.Close
> Set a = fso.GetFile("c:\testfile.txt")
> a.Copy ("c:\lpt1:")
> 'msgbox("helo")
> end function
> -->
> </SCRIPT>
>
> but after installing XP giving error ACTIVEX OBJECT CANT CREATE
> OBJECT.
>
>
> Can any one provide me a script that can run in XP
First of all, ASP is server-side technology, making this group the wrong
place to get quick help with client-side questions. Since you are using
vbscript, you will get help quicker by posting to
microsoft.public.scripting.vbscript
That said, you are going to find that browser security has been locked down
these days. Code such as the bit you are using was easily abused by hackers
to perform malicious actions. Client-side script no longer has easy access
to a user's file system. It may work if you can persuade the user to put
your site into his Trusted Zone. Switching to a .hta file instead of .htm
will also enable this security to be bypassed. And lastly, you need to worry
about users running anti-virus programs that interfere with the use of
FileScriptingObject.
Any further questions about this should be directed to the more appropriate
group. There are people with more knowledge of these matters that are
regulars on the .scripting groups.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"