closing PWB doesnot trigger user logoff even if LogOffOnExit=True

Questions and comments about currently under development PWB v3

Moderators: Tyler, Scott

Post Reply
hokazaki
Observer
Observer
Posts: 6
Joined: Thu Jan 22, 2026 7:10 pm

closing PWB doesnot trigger user logoff even if LogOffOnExit=True

Post 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
Attachments
PWB.INI
(6.33 KiB) Downloaded 5 times

Scott
Site Admin
Site Admin
Posts: 2585
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

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

Post 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

hokazaki
Observer
Observer
Posts: 6
Joined: Thu Jan 22, 2026 7:10 pm

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

Post 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

Scott
Site Admin
Site Admin
Posts: 2585
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

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

Post 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

Post Reply