Args
ARG(1) is 0 if the user clicked the Logoff or Shutdown button in the Shut Down Windows dialog box. ARG(1) is nonzero if the user clicked the End Task button in the Task List dialog box.
Return
An empty string to prevent shutdown, or 0 to allow it.
Notes
If you allow shutdown, then an ENDSESSION event will happen.
If you do not handle this event, then the operating system will assume that your script intends to allow the shutdown.
See also ENDSESSION.