Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Shutdown Batch File Fails

$
0
0
Hi,
 
I tried this script and modified a little bit to include to run my batch script before logging off or shutting down my win7 pc. However, my batch script didn't run. Any idea? Appreciate your help. Tnx
$WM_QUERYENDSESSION=0x0011 GUICreate"ShutDownNotificationGui" GUIRegisterMsg($WM_QUERYENDSESSION, "_ShutdownInitiated") GUISetSTate(@SW_HIDE) While 1         Sleep(10) WEnd   Func _ShutdownInitiated($hWndGUI, $MsgID, $WParam, $LParam)     If $WParam = 0 Then         RunWait(@COMSPEC & " /c c:\Mybatch.bat")         Msgbox(0,"","Shutting down")     EndIf     If BitAnd($WParam,0x80000000) = 0x80000000 Then         RunWait(@COMSPEC & " /c c:\Mybatch.bat")         Msgbox(0,"","logging off")         Return True     EndIf EndFunc

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>