Automation server can't create object

Bob3975
Bob3975 used Ask the Experts™
on
1) The script in question IS working on my remote host, it IS NOT working on my home development machine.
2) It was working at home but I recently bought a new system and can't get it going now.
3) I am running MDAC 2.8 SP1 on Windows XP SP2, this per the Microsoft Component Checker utility.
4) Anti-virus script blocking is disabled
5) My Internet Guest Account (IUSR_<machineName>) has full control over the folder containing the application
6) IIS virtual directory allows read and write, allows execute permission for scripts only, application protection is low
7) IIS directory security allows anonymous access for the Internet Guest Account (IUSR_<machineName>), allow 'IIS to control password' is checked

The ASP fails in both VBScript and javaScript.
==========================
VBScript:
   Dim objFileSystem, objOutputFile
   Dim strOutputFile
   Set objFileSystem = CreateObject("Scripting.fileSystemObject")
----------------------------
Fails with:
Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object: 'Scripting.fileSystemObject'
===========================
JavaScript:
    var fs=Server.CreateObject("Scripting.FileSystemObject");
---------------------------
Fails with:
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
Invalid class string
===========================
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2005

Commented:
What error do you get with this:

VBScript:
   Dim objFileSystem, objOutputFile
   Dim strOutputFile
   Set objFileSystem = Server.CreateObject("Scripting.fileSystemObject")

We should get a little more information.

FtB
Top Expert 2005

Commented:
Hi Bob3975,

Have you run the IIS Lockdown tool on this machine?

try re-registering the dll file scrrun.dll in the following manner:
start -> run... -> regsvr32 %windir%\system32\scrrun.dll



Top Expert 2005

Commented:
also, make sure IUSR user has execute permissions in %windir%\system32

OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

Author

Commented:
Maddog:
- regsvr32 %windir%\system32\scrrun.dll succeded with no change in problem.
- I doubt I ran IIS Lockdown, I have no idea what that is
- IUSR had 'read&write', 'list folder contents', and 'read'.  I added full control with no change in problem.

Fritz:
- it returns...
   Server object error 'ASP 0177 : 800401f3'
   Server.CreateObject Failed
   Invalid class string

OK... Firstly, there's nothing wrong with your ASP code above as you surmised... It will work on a local machine as I've copied/pasted your ASP code into a test page on my own machine but there is one slight hiccup...

When PWS is installed, the only web site it configures is called Default and that's the only web site you can use (otherwise it would be IIS and not PWS).

The default security settings for this are such that it limits access to almost everything that could damage your PC, including accessing files on the local HDD (thanks to those who wrote such viruses as RedAlert etc).

You need to reset the security settings for the Default website to allow your code to run correctly...

It's been a while since I modified my settings so perhaps someone else can confirm or embellish this as I'm bound to have forgotten something I changed...

The method I used to achieve this was to create a backup folder within the root of the website and move all the existing root contents there (including sub folders) to give me a clean workspace.

Add the IWAM_<MachineName> Account to the Inetpub/wwwroot folder security with at least Write permission...

I then modified my Default website properties to reflect the following...
Home Directory Tab
   Execute Permissions - Scripts only
   Application Protection = Medium (Pooled)
Directory Security Tab
   Edit Anonymous Access and check 'Integrated Windows authentication'

Hope this helps...
Top Expert 2005

Commented:
Okay, that is helpful.

This comes down to  one of two issues:

1) the object is not registered
2) you have invalid permissions.

Now, you have clearly indicated above that you have given the IUSR accout full permissions. You may need to do the same for IWAM.

If you want to rule out permissions altogether, then try creating a small .vbs file to use the FSO. If it works, then you know that the object is registered and that points to a configuration issue. If that does not run, that points to a permissions issue as unlikely as that seems given the information in your question.

FtB
Top Expert 2005
Commented:
Bob3975,

Sorry, meant IWAM user, it runs dlls <blush>
Top Expert 2005

Commented:
Whoops, sorry fritz... suggestion cross posted
Top Expert 2005

Commented:
It's okay, I just did the same to Dragonlaird in regards to the IWAM account issue.

FtB
Top Expert 2005

Commented:
I meant setting permissions on the directory that has scrrun.dll (%windir%\system32), the file that actually runs FileSystemObject.

Author

Commented:
Well, now I'm in free fall panic mode!  I added IWAM to the application directory and Windows\system32 and rebooted.  Now I get ...

Active Server Pages error 'ASP 0201'
Invalid Default Script Language
The default script language specified for this application is invalid.

on the asp page that has always begun with and still does begin with <%@ Language = javascript%>.  As well as the test VBScript I used earlier and is posted in the first comment!

Top Expert 2005

Commented:
Okay, what happens if you try setting the language to VBScript? Same problem?

I am starting to suspect that you may need to uninstall IIS and then do a reinstall.

FtB

Top Expert 2005
Commented:
Top Expert 2005

Commented:
Oh... I get it.

Go to IIS
right click on your website, go to the Home Directory tab.
Click on configuration, go to the options tab...

Write (yes, it's free text) VBScript in the "Default ASP language" textbox.

Author

Commented:
You gotta break a few eggs to make an omelet.  It was a sharing issue just like every web page I ever visited said it was, but it was the link fritz put up that solved it the invalid scripting language.

Here' what must have happened.  I've been changing permissions for a while trying to get the FSO to work and getting nowhere.  Then the IWAM thing and the reboot interacted with whatever I'd been doing to kill the site completely, even system restore couldn't fix it.  The link http://forums.aspfree.com/archive/t-31394 Fritz put up has a guy solving the invalid script language issue by removing the share on his directory and then re-sharing.  well, that solved both the invalid scripting language as well as the original issue where I couldn't instantiate the FSO.

I'll split the points with Fritz getting extra for that link.

You guys should visit  http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_21551169.html#14904151, he's got something nearly identical going on.  Then again, this might fix his also!

Thanks guys, but you had me soiling my shorts for a while!

Author

Commented:
BTW, It's running fine w/o IWAM.
Top Expert 2005

Commented:
Glad to have helped,

FtB

Author

Commented:
This has spawned another problem.  I'm posting here again hoping you guys will look into http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_21577042.html which I just posted.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial