Please see this post http://www.autoitscript.com/forum/topic/149641-how-to-force-a-power-down/page__st__20#entry1067760
I've started try to code this but I'm having trouble with the DLL syntax and I'd like to be sure that the system is safe to power down before I force it to do so.
I've tried:
But I can't determine if these functions are working correctly. Any help is greatly appreciated like always.
I've started try to code this but I'm having trouble with the DLL syntax and I'd like to be sure that the system is safe to power down before I force it to do so.
I've tried:
[ autoit ]
$iReturnValue = DllCall("advapi32.dll", "int", "RegFlushKey", "long", "HKEY_CLASSES_ROOT") if @error Then MsgBox(0, "", "Fail!") MsgBox(0, "Flush Home Key Classes Root", $iReturnValue) $bReturnValue = DllCall("kernel32.dll", "BOOL", "FlushFileBuffers", "HANDLE", "\\.\" & @HomeDrive) if @error Then MsgBox(0, "", "Fail!") MsgBox(0, "Flush System Drive Cache", $iReturnValue);Should return 1=true or 0=false.
But I can't determine if these functions are working correctly. Any help is greatly appreciated like always.