Jump to content

ActiveX component can't create object


Recommended Posts

I have the following error after my login script as processed;

Code 800A01AD - ActiveX component can't create object: 'Scripting.FileSystemObject' which refers to line 15 of my script;

Option Explicit

Dim objNetwork, strUNCPrinter, bForce, bUpdateProfile, loop_counter

Dim strDriveLetter, fs, WinDir, strComputer, GroupObj, WSHPrinters

Dim WSHShell, WSHNetwork, objDomain, DomainString, UserString, UserObj, Path

Dim hp_present, mc_present, lp_present, hp2_present

Set objNetwork = CreateObject("WScript.Network")

' wscript.echo "Starting"

!! THIS LINE!!Set fs = CreateObject("Scripting.FileSystemObject")

I have wscript version 5.6 and running server 2003 R2 64 bit SP2, any ideas??

Many thanks Jo

Link to comment
Share on other sites


It doesn't make sense if you've Dim'd it out, although using fs instead of objFSO or oFSO is technically bad form. Can you run the script after the user's logged in manually, or create a new one that just writes a test file similarly to see if it's a user permissions error?

Link to comment
Share on other sites

thanks,this isn't my script I've inherited it and your right this doesn't run after login, I am coming to conclusion to rewrite the entire script will be quicker in the long run than pickng my way through problems. Its' not dim'd out in the script I just put the remark to show which line is failing.

Link to comment
Share on other sites

using fs instead of objFSO or oFSO is technically bad form

Not everyone is that much into hungarian notation (there's quite a bit of people against that; but yeah vbscript is untyped...) Using just "fso" is just as good IMO. I tend to heavily use "shorthand" names like "fso" or "wsh" in vbscript. It's still rather obvious what it is (you kind of have to know what it is to actually make use of it in the first place), and it's quicker to type (yes, I *am* lazy).

Link to comment
Share on other sites

Whoops hope I haven't started an angry debate with this one. Thanks for all your comments, I'm probably going to go away andjust write a basic batch file now for my logins :0)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...