Announcement

Collapse
No announcement yet.

"ClassFactory cannot supply" error

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • "ClassFactory cannot supply" error

    Hi, guys.
    I have this script, plain and simple, to add a printer and make it default. At runtime, I get the error message shown in the screenshot attached.
    The environment is:
    - Win2003 Domain;
    - WinXPSP2 fully updated stations;
    - no GPO on both machine and user (I moved them to an OU with "Block Inheritance" flag set and no GPO linked to this OU);
    - user uses roaming profile;
    - user is Local Administrator.

    When I run this script on my computer, that is part of another domain, it runs without problems and even creates the printer . But when ran in the other domain, I get the error.
    I d it, but no real answers there...
    The script is:
    Set WshNetwork = CreateObject("WScript.Network")
    WshNetwork.AddWindowsPrinterConnection "\\server\printer1"
    WshNetwork.SetDefaultPrinter "\\server\printer1"


    Any ideas?
    Last edited by sorinso; 9th November 2007, 21:09.

    Sorin Solomon


    In order to succeed, your desire for success should be greater than your fear of failure.
    -

  • #2
    Re: "ClassFactory cannot supply" error

    As per this link http://www.winguides.com/scripting/reference.php?id=108
    try WScript.CreateObject in line 1

    Tom
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    PhD, MSc, FIAP, MIITT
    IT Trainer / Consultant
    Ossian Ltd
    Scotland

    ** Remember to give credit where credit is due and leave reputation points where appropriate **

    Comment


    • #3
      Re: "ClassFactory cannot supply" error

      Nope.
      Changed the command, same error.

      Sorin Solomon


      In order to succeed, your desire for success should be greater than your fear of failure.
      -

      Comment


      • #4
        Re: "ClassFactory cannot supply" error

        Have you considered reinstalling WSH?

        http://www.microsoft.com/downloads/d...displaylang=en
        Cheers,

        Rick

        ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

        2006-2099 R Valstar. This post is offered "as is" for discussion purposes only with no express or implied warranty of any kind including, but not limited to, correctness or fitness for use. Nothing herein shall be construed as advice. Attempting any activity based on information in this post is done at your own risk.

        Comment


        • #5
          Re: "ClassFactory cannot supply" error

          also seen this topic?
          http://forums.petri.com/showthread.php?t=11901
          Marcel
          Technical Consultant
          Netherlands
          http://www.phetios.com
          http://blog.nessus.nl

          MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
          "No matter how secure, there is always the human factor."

          "Enjoy life today, tomorrow may never come."
          "If you're going through hell, keep going. ~Winston Churchill"

          Comment


          • #6
            Re: "ClassFactory cannot supply" error

            Have you considered reinstalling WSH?
            10nx, Rick, for the link. The idea crossed my mind, especially because the script works on my computer, but not on the target ones . I'll give it a try.
            Yeah Marcel, saw it... What are you suggesting? That I should change the script? It's annoying, because it works on some computers and on others it don't. More than that, the script is taken from Microsoft's TechNet site, and it's only three lines Not that's a hundred-lines-long script and I missed something...
            I'll keep banging my head on this one and keep you posted, guys...

            Sorin Solomon


            In order to succeed, your desire for success should be greater than your fear of failure.
            -

            Comment


            • #7
              Re: "ClassFactory cannot supply" error

              ah, if the script works on some computers, while it won't run on others, then i go with Rick.
              Marcel
              Technical Consultant
              Netherlands
              http://www.phetios.com
              http://blog.nessus.nl

              MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
              "No matter how secure, there is always the human factor."

              "Enjoy life today, tomorrow may never come."
              "If you're going through hell, keep going. ~Winston Churchill"

              Comment

              Working...
              X