Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FileSystemObject error

Status
Not open for further replies.

AntiEarnie

Technical User
May 2, 2002
215
US
I'm at a loss on this. I have a simple script that grabs the windows error logs, saves them to disk, then resets the logs. The script I'm using works just fine on 3 other servers and a couple workstations. I have a problem server however that generates a Windows Script Host error when I try and run it though.

Error: Could not create object named "scripting.filesystemobject".
Code: 8000FFFF
Source: WScript.CreateObject

I haven't had any luck tracking this problem down on either the Microsoft site or off google. And the versions on this server match up with the other 3 servers for Windoes, IE, and WSH. I've tried reinstalling the WSH and IE patches again but that had no effect.

Microsft Windows 2000 Server
Service pack 4
patched the Windows Script Host up to 5.6, IE up to 6.0 sp1.


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''
''' This script gets the event log and dumps them to a local log folder.
'''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'Time to create the vars that hold the date and time
sDate = DatePart("m", Now) & "-"
sDate = sDate & DatePart("d", Now) & "-"
sDate = sDate & DatePart("yyyy", Now) & ""

sTime = DatePart("h", Now) & DatePart("n", Now)

set oFS = wscript.CreateObject("Scripting.FileSystemObject")


'If correct folder dosen't exist, make it
if oFS.FolderExists("\\Server-a\c\logs\" & sDate) then
else

'This section will create the target folder
set oFileSys = CreateObject("Scripting.FileSystemObject")
set oFolder = oFileSys.CreateFolder("\\Server-a\c\logs\" & sDate )
end if

'Gets the log files for this machine
strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate, (Backup, Security)}!\\" _
& strComputer & "\root\cimv2")

Set colLogFiles = objWMIService.ExecQuery _
("Select * from Win32_NTEventLogFile")


'This section goes out and gets the hostname this is run on for us.
strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)

For Each objItem in colItems
strHOSTNAME = objItem.Name
NEXT


'checks to make sure the folder exists, just in case link is down or something
if oFS.FolderExists("\\Server-a\c\logs\" & sDate) then
For Each objLogfile in colLogFiles
strBackupLog = objLogFile.BackupEventLog _
("\\Server-a\c\logs\" & sDate & "\" & strHOSTNAME & "_" & objLogFile.LogFileName & "_" & sDate & "_" & sTime & ".evt")
objLogFile.ClearEventLog()
Next
end if
 
JohnYngling, AFAIK NAV Corporate don't have Script blocking feature.
 
I agree norton isn't the problem... I have 2 win 2000 boxes and on one box I am having this same problem and on the other box the issue doesn't exist.

Here is the line of code blowing up
set objSettings = WScript.CreateObject("EdcorData.SettingsManager")

This problem is weird because I am getting the same error you are getting but I am getting with a different object. When I try to create a FileSystemObject it works fine.

Which leads me to beleive this issue has to do with the registry/installation of the dll.

Try unregistering and reregistering the Sripting Library dll. I beleive this file is c:\winnt\system32\scrrun.dll

This is just a hunch, I haven't fixed the problem with my object yet.

Mark W. Squires II
 
Heck the way things are looking it might be the same thing... Right now the problem is still unresolved. MS is dow to digging through dumps. All thats known for sure is that the FSO seems to be innocent. The problem appears to lie deeper. The scrrun.dll also seems innocent since we can replace it and still get this. Also, other objects in this dll work fine.

In the last few days we have done a number of things.

redownloaded and reinstalled wsh 5.6

confirmed the version numbers and such of scrrun.dll

rechecked permissions on FSO

unregestering scrrun.dll

confirming FSO gone in reg

reregestering scrrun

confirming the path class id has in reg for fso

and other various fun stuff using some debuggers to *hopefully* catch the real source of the error.
 
Hello AntiEarnie,

On the troubling machine, run the line at commandprompt see if it corrects the problem.
Code:
    wscript -regserver
regards - tsuji
 
Well it looks like the problem has been solved.

My coworker was tracking down some COM+ errors that were popping up and found that there were some errors in the COM+ Applicaitons in Component Services.

One of them was Scripting.FileSystemObject, ThreadingModle value has changed. As this was not present on its double he went and deleted the component. The object started working correctly again after that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top