Jump to content

Make restore point issues

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)
    If Not @error Then
        SplashTextOn('System Restore', 'System Restore Point Created Successfully.', 300, 45)
        SplashTextOn('System Restore Error', 'System Restore Point Was Not Created.', 300, 45)
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?

Share this post

Link to post
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

Share this post

Link to post
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

  • Similar Content

    • By Miliardsto
      Hello. How to make GUI restore from tray with slower speed or effect?
    • By Queener
      I'm not sure if I'm doing it right or there's a better way to restore windows from hidden in system tray, but if I remove the if statement then it's able to restore the program from system tray, but if I add the if statement then it doesn't restore it. Here's what I gotten so far and the reason why I use the if statement is because #32770 opens many other apps also.

      WinSetState("[CLASS:#32770]", "", @SW_SHOW) If WinExists($title_Pass_Entrance) Then WinWaitActive(WinActivate($title_Pass_Entrance))   ControlSend($title_Pass_Entrance, "", "[CLASS:Edit; INSTANCE:1]", "TempPassword")   ControlClick($title_Pass_Entrance, "", "[CLASS:Button; INSTANCE:2]", "left", 1) EndIf   >>>> Window <<<< Title:    Enter Safe Combination Class:    #32770 Position:    728, 411 Size:    465, 218 Style:    0x94C800C4 ExStyle:    0x00010101 Handle:    0x0000000000050A7A >>>> Control <<<< Class:     Instance:     ClassnameNN:     Name:     Advanced (Class):     ID:     Text:     Position:     Size:     ControlClick Coords:     Style:     ExStyle:     Handle:   
    • By JohnOne
      Feel free to post your windows 10 how to questions in here if you like.
      How to secure Windows 10: The paranoid's guide (external - zdnet)
      How to disable web search (within the windows search feature).
      How to determine which exact process under Service Host dropdown in task manager, is using the displayed overall network resources? (not a windows 10 feature)
    • By Chimaera
      Something i worked out today for checking browser
      Edge is not a traditional program (its an app to all intense and purpose) so not as simple to access
      This how i got it working 
      Local $edge_test = FileExists(@WindowsDir & '\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\MicrosoftEdge.exe') If $edge_test = 1 Then Local $edge = RunWait('explorer.exe shell:AppsFolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge') EndIf The runwait will work for other apps as well if you change the appfolder location to the right app
      There maybe other ways but this is best ive come up with so far
    • By zvvyt
      Hello ya'll!
      My problem is split in two, so I'll start with the first one:
      What I'm having is my script with dynamically created GUIs with similar / identical names. I would like to have that undepending on how many windows I have open to only have one "window" down at the taskbar.
      I guess all I need is the correct GUI style, but I can't find which one I need.
      Which brings me to problem part 2 (which I also find to be the easy part):
      Windows will open and close on random, so there's no set order in which they'll get closed. But I still need one "window" at the taskbar to work with as long as there's at least one window open.
      In the action of one of these windows getting minimized/restored all of the windows will act simultaneously.
      This will be solved with something similar: 

      case $GUI_EVENT_MINIMIZE          for $1 = 1 to Ubound($ActiveWindows) step +1                 WinSetState($ActiveWindows[$1], @SW_MINIMIZE)         Next And vice versa for restore.
      So .. Mainly prob #1 that I need some help with, and a thought about the "always one window at taskbar"-issue.
      Just point me in the right direction and I'll hopefully solve it myself ^__^'
      Thanks, and have a great weekend!
  • Create New...