I was getting tired of having to logout other users on my XP machine at home using the task manager. Essentially, my wife and assorted guests occasionally use the computer. Often they would remain logged in and running several applications. This caused me some issues with stability, but more often, with the system performance.
I sought a simple solution that would allow me to logout other users on the system with just a click of an icon, as opposed to the more time consuming effort required by using task manager. So a made a little batch file called logoutuser.bat for that purpose.
-----------------------------
@echo off
rem logoutuser.bat
for /F "tokens=2 skip=1" %%G IN ('qwinsta tammy') DO LOGOFF %%G
for /F "tokens=2 skip=1" %%G IN ('qwinsta guest') DO LOGOFF %%G
------------------------------
qwinsta lists the current system users, I select the most common offenders, and invoke the logoff command providing the users ID as a parameter (as provided by qwinsta).
I'd not found an adequate solution for this issue elsewhere, so I thought I'd just post it.