log off xp with a desktop shortcut.

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.


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.  :)
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

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
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...
coronalover4uAuthor Commented:
Hello EDStech

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

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows XP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.