Page 1 of 1

closing PWB doesnot trigger user logoff even if LogOffOnExit=True

Posted: Mon Sep 28, 2026 6:15 pm
by hokazaki
Dear support,

The LogOffOnExit=True config has been working until last Thursday (9/24/2026), but suddently stopped working on Friday (9/25/2026).
The PWB window closes, but the user does not get logged off.

PWB 3.2.0.8
OS Name: Microsoft Windows Server 2022 Datacenter
OS Version: 10.0.20348 N/A Build 20348

I attached the PW>INI file.
Please let me know if there are settings that I should check.

Regards,
Haruko

Re: closing PWB doesnot trigger user logoff even if LogOffOnExit=True

Posted: Tue Sep 29, 2026 10:49 am
by Scott
If it has been working up until recently and PWB v3 has not changed, the most likely problem is a Windows Update or another application has been installed or updated that is preventing PWB from logging off the computer.

PWB uses the Windows standard function "ExitWindowsEx" to log off the computer.

Code: Select all

        uAction = EWX_LOGOFF;
	// Shut down/log off the system and force all applications to close.
	if (!ExitWindowsEx(uAction, SHTDN_REASON_MAJOR_OPERATINGSYSTEM | SHTDN_REASON_MINOR_UPGRADE | SHTDN_REASON_FLAG_PLANNED))
		return FALSE;
--Scott

Re: closing PWB doesnot trigger user logoff even if LogOffOnExit=True

Posted: Tue Sep 29, 2026 10:57 am
by hokazaki
Hi Scott,

Thank you for your reply.

I would appreciate it if you could let me know how to trigger an exe file when the session timer expires, so I can run Logoff.exe and log the user off.
I appreciate your help.

Regards,
Haruko

Re: closing PWB doesnot trigger user logoff even if LogOffOnExit=True

Posted: Wed Sep 30, 2026 12:03 pm
by Scott
Use the following settings in your INI file to run a batch file when PWB exits.

[Inactivity]
InactivityAction=Exit

[Files]
ShutdownScript=

For example:
ShutdownScript=C:\PWB\logoff.cmd

--Scott