Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Shutdown /l shutting down the computer, not logging off.

19 Jun 2015   #1

Windows 7 Home Editon - Windows 10 Proffesional Build 10130
Shutdown /l shutting down the computer, not logging off.

I made this bat file to protect my files from my mom. Unfortunately if I want her to be able to log off of my locked account and go back to hers, the bat file shuts down the computer instead of logging off. I cant figure it out and it cant leave a log cuz, well, it shut down. So im stuck. Ill post the code and see if anyone can fix it
Thanks in advance,

Code: Click me

My System SpecsSystem Spec
19 Jun 2015   #2

Windows 7 Ultimate x64 SP1

You should re-attach that file here Screenshots and Files - Upload and Post in Seven Forums
My System SpecsSystem Spec
19 Jun 2015   #3

Windows 10 Pro X64

This is what linuxfan1 posted:

@echo off
 taskkill /f /IM explorer.exe 
 echo Enter password to login, Enter * to logout:
 SET /P M=
 IF %M%==password GOTO :start
 IF %M%==* "C:\Users\Nathan\Desktop\Old Desktop\Logoff.bat"
 start C:\Windows\explorer.exe
 taskkill /pid cmd.exe
Also need logoff.bat which was not posted.
My System SpecsSystem Spec

21 Jun 2015   #4

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan

Quote   Quote: Originally Posted by Ztruker View Post
Also need logoff.bat which was not posted.
Missing the most relevant piece of information, Linuxfan.

What is the purpose of a Logoff.bat anyway if (I'm assuming) it only contains shutdown /l? Wouldn’t it be easier to just write
if %M%==* shutdown /l

I recommend using the logoff command rather than shutdown /l for logging off the current user.
My System SpecsSystem Spec

 Shutdown /l shutting down the computer, not logging off.

Thread Tools

Similar help and support threads
Thread Forum
BSOD when logging off and issues shutting down
Hi, Recently my computer has been having regular blue screens. On average, this is happening once a week, and as you can imagine is very annoying. This always seems to happen when logging out of an account. Another problem I have, which I think could be related, is that the computer doesn’t shut...
BSOD Help and Support
Windows hangs on logging off/shutting down
Exactly what the title says. Also I'm not sure if this is related but every time I try to make a restore point it says "Shadow copy timed out". It started doing this like a few days ago and I've successfully made several restore points before this. However, now it says that I only have one restore...
General Discussion
my computer is not shutting down,it restarts when i do a shutdown
when i try to shut down my pc n i cliked d shut down button....... it automatically resarts again ......... pls help me guyss........:D
Performance & Maintenance
BSOD Seem to happen only when Shutting down or logging off - ntkrnlmp
Windows 7 x64 Fully updated. System has passed 8 hours of memtest with no errors. Have run CHKDSK /F on all the drives. When I hit shutdown or log off about once every 3-5 days I get this BSOD ntkrnlmp.exe Thanks for your guys help! :D Magoo
BSOD Help and Support
Logging Off/Shutting Down Forever...
Keep trying to turn my laptop off and it keeps saying either 'Logging Off' or 'Shutting Down' forever until i manually turn off my laptop by using the power button. Anyone know why this is happening???????
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 13:57.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App