-
Automation server can't create object
Hello,
I am getting a 'cant create object error when trying to run the code below.
It errs on the line 'Filesystem = new ActiveXObject("Scripting.FileSystemObject")'.
Does anyone know what may be going wrong?
Thanks
Dan
<%@ LANGUAGE=JavaScript %>
<%
var Filesystem, drv, drvs, enumdrvs
Filesystem = new ActiveXObject("Scripting.FileSytemObject")
drvs = Filesystem.drives
enumdrvs = new enumerator(drvs)
enumdrvs.movefirst()
while (! enumdrvs.atend() ) { %>
drive: <%=enumdrvs.item().driveletter%><p>
<% if (enumdrvs.item().isready == true) { %>
volume: <%=enumdrvs.item().volumename%><p>
space free: <%=enumdrvs.item().freespace%> bytes<p>
<% } else { %>
drive isn't ready.<p>
<% }
enumdrvs.movenext()
}
%>
-
Re: Automation server can't create object
I'm having the same problem, if you have a solution by now, please mail it
to me, it seems that the problem is occurs only when you try to run it on
a client, when you try it local it works perfectly.
"dan" <none@noemail.com> wrote:
>
>Hello,
> I am getting a 'cant create object error when trying to run the code below.
> It errs on the line 'Filesystem = new ActiveXObject("Scripting.FileSystemObject")'.
> Does anyone know what may be going wrong?
>Thanks
>Dan
>
><%@ LANGUAGE=JavaScript %>
><%
>var Filesystem, drv, drvs, enumdrvs
I'm having the same problem whith javascript
>Filesystem = new ActiveXObject("Scripting.FileSytemObject")
>drvs = Filesystem.drives
>enumdrvs = new enumerator(drvs)
>enumdrvs.movefirst()
>while (! enumdrvs.atend() ) { %>
>drive: <%=enumdrvs.item().driveletter%><p>
><% if (enumdrvs.item().isready == true) { %>
>volume: <%=enumdrvs.item().volumename%><p>
>space free: <%=enumdrvs.item().freespace%> bytes<p>
><% } else { %>
>drive isn't ready.<p>
><% }
> enumdrvs.movenext()
> }
> %>
-
Re: Automation server can't create object
I'm going to guess that it is because of Browser Security. Most web browsers
have thier security set so that the local file system can not be tampered
with when viewing a page that is not local to the machine. So most likely
your only ability to access the file system is going to be by using the Common
Dialog ActiveX component.
James
"Hans van Doormalen" <waterdrops2@hotmail.com> wrote:
>
>I'm having the same problem, if you have a solution by now, please mail
it
>to me, it seems that the problem is occurs only when you try to run it on
>a client, when you try it local it works perfectly.
>
>"dan" <none@noemail.com> wrote:
>>
>>Hello,
>> I am getting a 'cant create object error when trying to run the code
below.
>> It errs on the line 'Filesystem = new ActiveXObject("Scripting.FileSystemObject")'.
>> Does anyone know what may be going wrong?
>>Thanks
>>Dan
>>
>><%@ LANGUAGE=JavaScript %>
>><%
>>var Filesystem, drv, drvs, enumdrvs
>I'm having the same problem whith javascript
>
>>Filesystem = new ActiveXObject("Scripting.FileSytemObject")
>>drvs = Filesystem.drives
>>enumdrvs = new enumerator(drvs)
>>enumdrvs.movefirst()
>>while (! enumdrvs.atend() ) { %>
>>drive: <%=enumdrvs.item().driveletter%><p>
>><% if (enumdrvs.item().isready == true) { %>
>>volume: <%=enumdrvs.item().volumename%><p>
>>space free: <%=enumdrvs.item().freespace%> bytes<p>
>><% } else { %>
>>drive isn't ready.<p>
>><% }
>> enumdrvs.movenext()
>> }
>> %>
>
-
Re: Automation server can't create object
Assuming that you copy/pasted the code into the original
message "Scripting.FileSytemObject")
is misspelled.
it should be ("Scripting.FileSystemObject")
"dan" <none@noemail.com> wrote in message news:38d8e09d$1@news.devx.com...
>
> Hello,
> I am getting a 'cant create object error when trying to run the code
below.
> It errs on the line 'Filesystem = new
ActiveXObject("Scripting.FileSystemObject")'.
> Does anyone know what may be going wrong?
> Thanks
> Dan
>
> <%@ LANGUAGE=JavaScript %>
> <%
> var Filesystem, drv, drvs, enumdrvs
> Filesystem = new ActiveXObject("Scripting.FileSytemObject")
> drvs = Filesystem.drives
> enumdrvs = new enumerator(drvs)
> enumdrvs.movefirst()
> while (! enumdrvs.atend() ) { %>
> drive: <%=enumdrvs.item().driveletter%><p>
> <% if (enumdrvs.item().isready == true) { %>
> volume: <%=enumdrvs.item().volumename%><p>
> space free: <%=enumdrvs.item().freespace%> bytes<p>
> <% } else { %>
> drive isn't ready.<p>
> <% }
> enumdrvs.movenext()
> }
> %>
-
angels & demons
well i’ve been fighting for 2 days..for this ***in error..
and i found the cause….which is..
1> whenever you try to access system files from your machine…system security layer won’t allow it..
2> windows script 5.6 update..
solution..
1> open your web browser..go to internet options..choose
security tab..after that click on custom level
button..
after that..set options for download signed activex control…set to enable..
next download unsigned activex control..set to enable..
(setting this will clear all the problems..
because when user try to run that script..
at run time..user trying to load activex control..
which won’t be created & hence the error..)
and try to keep the custom settings..medium low or low..
and windows script 5.6 ..update..i’m not sure..about that
crap..
******** This will work on any OS..
doesn't matter if it's asp,jsp,asp.net,php...or any other new lang.
you ppl know..just try...
in case if my written **** won’t work..
you should try for window script 5.6 update..
sorry guys i’m lil..drunk right now..
-
done...
well i’ve been fighting for 2 days..for this ***in error..
and i found the cause….which is..
1> whenever you try to access system files from your machine…system security layer won’t allow it..
2> windows script 5.6 update..
solution..
1> open your web browser..go to internet options..choose
security tab..after that click on custom level
button..
after that..set options for download signed activex control…set to enable..
next download unsigned activex control..set to enable..
(setting this will clear all the problems..
because when user try to run that script..
at run time..user trying to load activex control..
which won’t be created & hence the error..)
and try to keep the custom settings..medium low or low..
and windows script 5.6 ..update..i’m not sure..about that
****..
in case if my written **** won’t work..
you should try for window script 5.6 update..
sorry guys i’m lil..drunk right now..but i 'm right..
-
Same problem for windows 7 with Visual web 2008
i got the same error
Microsoft JScript runtime error: Automation server can't create object
when
var x = ActiveXObject("Scripting.FileSystemObject");
has enybody solved this problem?
There is another way of copying a file in javascript except this one?
I appreciate any help
-
Great article, I'll pass it onto my colleague who is doing a little research on that. Thanks!
zhu zhu pets hamster
Last edited by oracle; 05-17-2010 at 02:47 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks