Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. Automation server can't create object

Automation server can't create object

Scheduled Pinned Locked Moved JavaScript
sysadmintestingtoolshelp
10 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ali Al Omairi Abu AlHassan
    wrote on last edited by
    #1

    guys, i use this code to get the the size of the file to upload but i get the exception "Automation server can't create object"

        function GetFileSize(filespec)
        {
            var filesystemobject = new ActiveXObject("Scripting.FileSystemObject");
            var file = filesystemobject.GetFile(filespec);
            return file.Size;
        }
    

    please, Help me.

    Help people,so poeple can help you.

    W P 2 Replies Last reply
    0
    • A Ali Al Omairi Abu AlHassan

      guys, i use this code to get the the size of the file to upload but i get the exception "Automation server can't create object"

          function GetFileSize(filespec)
          {
              var filesystemobject = new ActiveXObject("Scripting.FileSystemObject");
              var file = filesystemobject.GetFile(filespec);
              return file.Size;
          }
      

      please, Help me.

      Help people,so poeple can help you.

      W Offline
      W Offline
      WoutL
      wrote on last edited by
      #2

      Did you try to google for an answer? On the first page I found this[^]

      Wout Louwers

      A 1 Reply Last reply
      0
      • W WoutL

        Did you try to google for an answer? On the first page I found this[^]

        Wout Louwers

        A Offline
        A Offline
        Ali Al Omairi Abu AlHassan
        wrote on last edited by
        #3

        Sir, I put my path and server on the RemoteText.wsf file, but this didnt work.

        <package>
        <job>
        <script language="VBScript">
        set oController = CreateObject("WSHController")
        set oProcess = oController.CreateScript("D:\Work\RemoteFile.wsf", "localhost")
        WScript.ConnectObject oProcess, "remote_"
        oProcess.Execute
        While oProcess.Status <> 2
        WScript.Sleep 100
        WEnd
        WScript.Echo "Done"

        Sub remote_Error
        Dim theError
        Set theError = oProcess.Error
        WScript.Echo "Error - Line: " & theError.Line & ", Char: " & theError.Character & vbCrLf & "Description: " & theError.Description
        WScript.Quit -1
        End Sub

        </script>
        </job>
        </package>

        Help people,so poeple can help you.

        W 1 Reply Last reply
        0
        • A Ali Al Omairi Abu AlHassan

          Sir, I put my path and server on the RemoteText.wsf file, but this didnt work.

          <package>
          <job>
          <script language="VBScript">
          set oController = CreateObject("WSHController")
          set oProcess = oController.CreateScript("D:\Work\RemoteFile.wsf", "localhost")
          WScript.ConnectObject oProcess, "remote_"
          oProcess.Execute
          While oProcess.Status <> 2
          WScript.Sleep 100
          WEnd
          WScript.Echo "Done"

          Sub remote_Error
          Dim theError
          Set theError = oProcess.Error
          WScript.Echo "Error - Line: " & theError.Line & ", Char: " & theError.Character & vbCrLf & "Description: " & theError.Description
          WScript.Quit -1
          End Sub

          </script>
          </job>
          </package>

          Help people,so poeple can help you.

          W Offline
          W Offline
          WoutL
          wrote on last edited by
          #4

          Did you try to register the WScript object as stated in the article?

          Wout Louwers

          A 1 Reply Last reply
          0
          • W WoutL

            Did you try to register the WScript object as stated in the article?

            Wout Louwers

            A Offline
            A Offline
            Ali Al Omairi Abu AlHassan
            wrote on last edited by
            #5

            ok, sir. is there any way to obtain the file size other than ActiveX(Since ActiveX is not supported on operating systems other than windows)

            Help people,so poeple can help you.

            W 1 Reply Last reply
            0
            • A Ali Al Omairi Abu AlHassan

              ok, sir. is there any way to obtain the file size other than ActiveX(Since ActiveX is not supported on operating systems other than windows)

              Help people,so poeple can help you.

              W Offline
              W Offline
              WoutL
              wrote on last edited by
              #6

              Not that I know of. Sorry.

              Wout Louwers

              1 Reply Last reply
              0
              • A Ali Al Omairi Abu AlHassan

                guys, i use this code to get the the size of the file to upload but i get the exception "Automation server can't create object"

                    function GetFileSize(filespec)
                    {
                        var filesystemobject = new ActiveXObject("Scripting.FileSystemObject");
                        var file = filesystemobject.GetFile(filespec);
                        return file.Size;
                    }
                

                please, Help me.

                Help people,so poeple can help you.

                P Offline
                P Offline
                Pravin Patil Mumbai
                wrote on last edited by
                #7

                Try this : 1. Go to internet explorer, Tools menu -> Internet options 2. Go to second tab -> Security 3. Enable ActiveX controls and plug ins options. Hope this helps. All the best.

                A 1 Reply Last reply
                0
                • P Pravin Patil Mumbai

                  Try this : 1. Go to internet explorer, Tools menu -> Internet options 2. Go to second tab -> Security 3. Enable ActiveX controls and plug ins options. Hope this helps. All the best.

                  A Offline
                  A Offline
                  Ali Al Omairi Abu AlHassan
                  wrote on last edited by
                  #8

                  thank you, sir; but i don't think that ActiveX works on other browsers (like Fire Fox) or Operating Systems (like Linux) so, i quit using ActiveX. 100 :rose:, man.

                  Help people,so poeple can help you.

                  X 1 Reply Last reply
                  0
                  • A Ali Al Omairi Abu AlHassan

                    thank you, sir; but i don't think that ActiveX works on other browsers (like Fire Fox) or Operating Systems (like Linux) so, i quit using ActiveX. 100 :rose:, man.

                    Help people,so poeple can help you.

                    X Offline
                    X Offline
                    Xandip
                    wrote on last edited by
                    #9

                    Hi there, you got any workaround for this problem..? or any solution..?? i'm also facing the same problem.. :(

                    A 1 Reply Last reply
                    0
                    • X Xandip

                      Hi there, you got any workaround for this problem..? or any solution..?? i'm also facing the same problem.. :(

                      A Offline
                      A Offline
                      Ali Al Omairi Abu AlHassan
                      wrote on last edited by
                      #10

                      no; sir. :-D

                      Help people,so poeple can help you.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups