With the below command I am able to revert a virtual machine in vmware workstation to a snapshot mentioned.
$sVMPath = <path of the vmx file of virtual machine> $sSnapshot = <snapshot name> $Ret = RunWait(@ComSpec & " /c VMRun.exe -T WS revertToSnapshot ""$sVMPath$"" ""$sSnapshot$"" nogui", "", @SW_HIDE) But the problem here is the virtual machine may contain multiple snapshots with same name because multiple users use same workstation and eventually they are keeping same name sometimes like below or in attachment.
Both snapshots are with same name and in GUI we can use them with no issue.
But with autoit or with vmrun command line it is showing error as
Error: The name does not uniquely identify one snapshot Could anyone please help me on this.
I know this is usually something that windows sucks at, but I found this https://msdn.microsoft.com/en-us/library/hh830479(v=vs.85).aspx and wondered, would it be possible to access System Management Bus from autoit? SMBus is VERY similar to I2C, which a lot of microcontrollers support amongst other sensors and devices. It would be awesome to tap into it from autoit!
Has anyone tried it?
I copied a script from here and was able to get it so that when the screen is unlocked it displays a message, however what I would like to have happen is only the display a message once, but keep the script running at all times, and then every time the workstation is unlocked display a message.
Here is what I have so far.
Global Const $DESKTOP_SWITCHDESKTOP = 0x100 While 1 If _CheckLocked() = 0 Then msgbox(0, "", "Test") EndIf WEnd Func _CheckLocked() $hLockedDLL = DllOpen("user32.dll") $hDesktop = DllCall($hLockedDLL, "int", "OpenDesktop", "str", "Default", "int", 0, "int", 0, "int", $DESKTOP_SWITCHDESKTOP) $ret = DllCall($hLockedDLL, "int", "SwitchDesktop", "int", $hDesktop) DllCall($hLockedDLL, "int", "CloseDesktop", "int", $hDesktop) If $ret = 0 Then $iLocked = 1 ElseIf $ret = 1 Then $iLocked = 0 EndIf DllClose($hLockedDLL) If $iLocked Then Return 1 Else Return 0 EndIf EndFunc