Please see this post 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: $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