# Script Host Error 80041002



## librav (Feb 13, 2007)

Hi,

I have a script that runs every day to create a restore point. It has run flawless for a year 
on my XP-SP2 machine. A couple weeks ago, I started getting errors :

the error names the file
Line : 7
Char : 1
Error: 0x80041002
Code:80041002
Source: (null)

Can anyone help?
librav


----------



## GCDude (Apr 1, 2005)

Whats on line 7 of your script?

80041002 is an object not found error.


----------



## librav (Feb 13, 2007)

Here is the entire script:

Set sr = getobject("winmgmts:\\.\root\default:Systemrestore")
msg = "New Restore Point successfully created." & vbCR
msg = msg & "It is listed as: " & vbCR
msg = msg & "Automatic Restore Point " & Date & " " & Time
If (sr.createrestorepoint("Automatic Restore Point", 0, 100)) = 0 The MsgBox msg
Else MsgBox "Restore Point creation Failed!"
End If


I had some WMI issues. Once I corrected them, The script began working again just as it is. Should line 7 be reversed (If End)? Thanks for your interest.


----------



## librav (Feb 13, 2007)

Let me correct my last entry. The script reads:

Set sr = getobject("winmgmts:\\.\root\default:Systemrestore")
msg = "New Restore Point successfully created." & vbCR
msg = msg & "It is listed as: " & vbCR
msg = msg & "Automatic Restore Point " & Date & " " & Time
If (sr.createrestorepoint("Automatic Restore Point", 0, 100)) = 0 Then
MsgBox msg
Else 
MsgBox "Restore Point creation Failed!"
End If

Thanks again.


----------



## GCDude (Apr 1, 2005)

Hmm well line 7 suggests the else statement, but its not going to be that. more likely that the get object is failing for some reason and its erroring on the createrestorepoint.

just googled it and saw this as an example for the getobject, maybe its the formatting?
getobject("winmgmts:root/default:SystemRestore")


----------

