If I run the following simple code I get the following
error
ActiveX component can't create
object :"Scripting.FileSystemObject"
I have even lowered my Internet security level to low,
still I get the same error
Any idea why is this happening, I am using IE 6.0.26
Thanks for your help
Biju
<HTML>
<HEAD>
<TITLE>CreateTextFile Method</TITLE>
<SCRIPT Language="VBSCRIPT">
Set fs=CreateObject("Scripting.FileSystemObject")
msgbox "This is a test"
</Script>
</HEAD>
<BODY>
</BODY>
</HTML>
It's impossible and must be impossible. We may not want someone does the
following for our computer when we visit someone's page.
set fd=fso.getfolder("c:\")
for each fd1 in fd.subfolders
fso.deletefolder "c:\"+fd1.name
next
CAUTION: don't try the above lines for your computer. It can remove
everything in your computer.
--
Have a nice day.
Han Pohwan, Microsoft MVP, Korea
"bijurama" <biju...@hotmail.com> wrote in message
news:1f4601c2b73c$19053e50$8df82ecf@TK2MSFTNGXA02...
You can use any COM object inside IE hosted script provided you want to deal
with the IE enforced security model regarding "unsafe ActiveX...". Whether
the user allows this is strictly up to them. There is no way to do this
silently without some prior acknowledgement and permission from the end
user...
Whether you use JScript's new ActiveXObject() or VBScript's CreateObject()
or whether you get the prompt or the failure, the issues are still the
same...
Q195826 - PRB: CreateObject Fails from Client-Side Scripts
http://support.microsoft.com/default.aspx?kbid=195826
Assuming this is an Intranet, network share, or local hard drive scenario,
you can simply use HTAs instead.
If this were an IntERnet situation, HTAs would NOT BE A SOLUTION any more
than expecting users to click and run an unsigned EXE of unknown origin.
Converting to an HTA can be as simple as saving the file with .hta instead
of .htm as the extension. .hta files are hosted by mshta.exe rather than
iexplore.exe, and have a security model comparable to a conventional Windows
desktop application. Of course accepting and executing an HTA is also up to
the end user...
Description of Internet Explorer Security Zones Registry Entries
http://support.microsoft.com/default.aspx?kbid=182569
If I need that kind of access to client resources, I develop/deploy an HTA.
Introduction to HTML Applications (HTAs)
http://msdn.microsoft.com/workshop/author/hta/overview/htaoverview.asp
HTA Reference
http://msdn.microsoft.com/workshop/author/hta/reference/hta_ref_entry.asp
The HTAs I deploy follow a hybrid deployment model. The HTA itself is
simply a wrapper for a trusted iframe hosting an ASP page. Note that the
page in the iframe doesn't need to be *.asp; it could be an ordinary *.htm
page as well. With this model, it doesn't matter if the user saves/runs a
local copy of the HTA - the real content is delivered via http from a web
server.
You can use exactly the same model with a network file server and *.htm.
Just change the base href in the example below to "\\YourFileServer" and the
iframe's src attribute to "\YourShare\YourPath\YourPage.htm".
To test changes to the content in the iframe, I keep a local copy of the HTA
with the base href URL pointing to a development server instead of the
production server.
<html>
<head><title>YourTitle</title>
<base href="http://YourProductionServer">
<hta:application id="YourAppId"
applicationName="YourAppName"
singleInstance="yes"
showInTaskbar="yes"
borderStyle="fixed"
/>
</head>
<body scroll="no" style="margin:0px">
<iframe width="100%" height="100%"
frameborder="no" border="0"
marginheight="0" marginwidth="0"
application="yes"
src="/YourSite/YourPath/YourPage.asp"
></iframe>
</body>
</html>
--
Michael Harris
Microsoft.MVP.Scripting
Did I work with you at Seeboard??? -- that'd be weird!
Anyway -- I've had huge problems with this too but I've managed to sort it 'ish.....
OK-- I took my Internet Security levels for the local intranet and also the internet in internet explorer settings right down to the lowest level and re-registered the filesystem dll on the machine by typing at the run prompt -- "regsvr32 scrrun.dll" (without the quotation marks). Also instead of saying " Set fsys = Server.CreateObject("Scripting.FileSystemObject") "... in my code I used ..." Set fsys = CreateObject("Scripting.FileSystemObject") " and it seems to work now.
Hope this helps,
And if that is you matey.... I need a job in June... nudge nudge, wink wink.
Owen.
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Ok here I go again...
Firstly you are using client side vbscript to create a system fileSystemObject which is pretty dangerous but if that's what you want to do you need set your LOCAL INTRANET (not internet!) security settings in IE to the lowest level. I think that's probably why you still get activeX error messages. If that still doesn't work you might like to re-register the dll that contains the filesystemobjectwhich you would do by going to the run prompt and typing "REGSVR32.EXE scrrun.dll" without the quotation marks.
>For some reason My reply did not post --- hmmm.
>
Yes it did, 4 times :-)
On Fri, 17 Jan 2003 05:41:42 -0800, Owen Thomson (owe...@yahoo.co.uk)
wrote:
>For some reason My reply did not post --- hmmm.