AntiEarnie
Technical User
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
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