Automation server can't create object


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: Automation server can't create object

  1. #1
    dan Guest

    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()
    }
    %>

  2. #2
    Hans van Doormalen Guest

    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()
    > }
    > %>



  3. #3
    James Guest

    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()
    >> }
    >> %>

    >



  4. #4
    Gene Black Guest

    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()
    > }
    > %>




  5. #5
    Join Date
    Apr 2008
    Posts
    2

    Thumbs up 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..

  6. #6
    Join Date
    Apr 2008
    Posts
    2

    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..

  7. #7
    Join Date
    Apr 2010
    Posts
    1

    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

  8. #8
    Join Date
    May 2010
    Posts
    5
    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 03: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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center