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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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.  :)
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
Are you unable to synchronize your OST (Offline Storage Table) file with Microsoft Exchange Server? Is your OST file exceeding 2 GB size limit? In Microsoft Outlook 2002 and earlier versions, there is a 2 GB size limit for the OST file. If the file …
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 this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month9 days, 8 hours left to enroll

762 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