Jump to content

Make restore point issues


 Share

Recommended Posts

Ive had a bit of code from a long time ago and its always worked perfectly until recently

It creates a restore point of a given name that i choose and i use it when i finalize a customers pc to go back to them.

the original code was from Venom 007

Global $CuDate = _Date_Time_GetLocalTime()
Global $sRestorePointName = 'Tech_Finish ' & StringTrimRight(_Date_Time_SystemTimeToDateTimeStr($CuDate), 9)

Func _CreateRestorePoint($sRestorePointName) ; Author = Venom007
    SplashTextOn('Restore Point', 'Creating Restore Point.' & @CRLF & @CRLF & _
            'Please Wait', 300, 90, -1, -1, 18)
    Local $objSystemRestore
    $objSystemRestore = ObjGet('winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore')
    If Not $objSystemRestore.createrestorepoint($sRestorePointName, 0, 100) = 0 Then SetError(1)
    SplashOff()
    If Not @error Then
        SplashTextOn('System Restore', 'System Restore Point Created Successfully.', 300, 45)
        Sleep(2000)
        SplashOff()
    Else
        SplashTextOn('System Restore Error', 'System Restore Point Was Not Created.', 300, 45)
        Sleep(2000)
        SplashOff()
    EndIf
EndFunc   ;==>_CreateRestorePoint

Just recently now im seeing windows 10 machines it fails at this line im pretty sure

$objSystemRestore = ObjGet('winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore')

Does anyone know what has changed in win 10 to cause this?

Link to comment
Share on other sites

Link to comment
Share on other sites

that line works for me. windows 10 Pro x86.

hmm so why does it fail for me then weird

They were brand new machines that had been upgraded to win 10 from 8.1, is yours an original licence install or upgrade

Link to comment
Share on other sites

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...