Jump to content

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?

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

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By TXTechie
      Hello Everyone,
      I've developed my own GUI using AutoIt and I'm allowing users to minimize the GUI, but I also want to include some kind of timer so that it will automatically restore the GUI after something like 30 minutes or an hour. However, I also want them to be able to manually restore the GUI by clicking the application's icon in the taskbar.
      I've searched through the forums, but I'm not sure how to get started.
      Any ideas or functions to research are appreciated!
      TX Techie
    • By Jahar
      Hi All,
      Please help me on how to fetch date/time of last windows 10 system restore point using autoit? Basically its about querying the last restore point.
    • By AutoitMike
      Scite 3.4.4
      Win 10
      I click "Help" or press F1, there is no response
      If I use the file explorer and double click Autoit.chm or Autoit3.chm help opens.
      There is no dialog to check or uncheck "Always ask before opening this file" when clicking on these files.
      If you are curious as to why I dont have the latest version, I am creating a back up laptop that has a VERY extensive automation application that I have written over the past 15 years.
      An extremely potent, powerful, needed function has been deleted in the upgrade of Autoit in recent years that I can not do without. If my main laptop dies, which it almost did, I am in a very bad position. So I bought the exact same laptop and I am "cofiguring" it to work exactly the same as my main laptop. However, this one has been "Upgraded" to Win 10 which I hope is not the problem. 
      Thanks for any help
    • 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:   
  • Create New...