1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Script Host Error 80041002

Discussion in 'Software Development' started by librav, Feb 13, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. librav

    librav Thread Starter

    Joined:
    Feb 13, 2007
    Messages:
    3
    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
     
  2. GCDude

    GCDude

    Joined:
    Apr 1, 2005
    Messages:
    394
    Whats on line 7 of your script?

    80041002 is an object not found error.
     
  3. librav

    librav Thread Starter

    Joined:
    Feb 13, 2007
    Messages:
    3
    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.
     
  4. librav

    librav Thread Starter

    Joined:
    Feb 13, 2007
    Messages:
    3
    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.
     
  5. GCDude

    GCDude

    Joined:
    Apr 1, 2005
    Messages:
    394
    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")
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/543812

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice