Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


log off xp with a desktop shortcut.

Posted on 2003-02-20
Medium Priority
Last Modified: 2008-03-04
I was wondering if someone knew what the command is to make a shortcut to log off windows xp. I found one to lock windows xp like so: rundll32.exe user32.dll, LockWorkStation .

But that just locks the windows session and wont let you switch users unless you click ok to another pop promt. I need a shortcut that will actuly log off the user so another user can log on.


Question by:coronalover4u
LVL 44

Accepted Solution

CrazyOne earned 200 total points
ID: 7991627
Syntax for Windows XP:

      SHUTDOWN [options] [-m [\\ComputerName]]  

   -M \\Computer  : A remote computer to shutdown.
   -L          : logoff current user

   -c "Msg"    : An optional shutdown message
   -S          : Shutdown

   -R          : Shutdown and reboot

   -A          : Abort a system shutdown during the timeout period.

   -T:xx       : Set the timer for system shutdown in seconds.[20 sec. default]

   -F          : Force running applications to close.
                 ATTENTION: If you use the -F parameter shutdown will not
                            prompt for File-Save in any open applications.
                            This will result in a loss of all unsaved data!!!

   -d u:xx:yy   : List a USER reason code for the shutdown.
   -d P:xx:yy   : List a PLANNED reason code for the shutdown.
                   xx Specifies the major reason code (0-255)
                   yy Specifies the minor reason code (0-65536)
When using this command to reboot a server - the shutdown can be made faster if the services are halted using NET STOP - the NT shutdown process will normally allow about 30 seconds to ensure each running service has time to stop.

net stop "Microsoft Exchange Internet Mail Service"
net stop "Microsoft Exchange System Attendant" /y
wait 20
shutdown /Y /T:5 /C /R
LVL 44

Expert Comment

ID: 7991635

Expert Comment

ID: 8012562
Actually Crazy, I think you meant:

shutdown.exe -l -f

Using -s would make the machine physically shut down, not simply log off.

Note to coronalover:  If the shutdown command line deal works for you, award the points to Crazy.. I'm simiply correcting what I think is a typo.  :)
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Expert Comment

ID: 8038294
This may be too simple, but Have you enabled fast user switching in the User accounts window?

Like This:

while logged on as administrator, open user accounts in control panel

click "change the way users log on or off"

check "use fast user switching"

then "apply options"

This combined with your shortcut should do the trick

Expert Comment

ID: 8038354
Fast user switching is bad.. very bad.  It'll degreade the performance of the computer significantly if it's not used properly.

Crazyone's suggestion will do exactly what Corona is asking...

Author Comment

ID: 8039283
Hello EDStech

In the name of learning. Can you please share your expereince with the Fast user switching and how it degrades the performace?


Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Can you find a fax from a vendor you saved a decade ago in seconds? Have you ever cursed your PC under your breath during an audit because you couldn’t find the requested statement or driver history?  If you answered no to the first question or yes …
Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question