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 as computer shutdown, turns on after shutdown
I have shutdown correctly, but I get BSOD and then it shutdowns, but then it turns on again.
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
PC hangs on shutdown; loses video when logging out
Hello everyone! Normally, I am able to fix my computer problems but I've come to a problem that I can't figure out. Every time I go to shutdown, it hangs on the "Shutting Down..." screen. Also, every time I go to log out, I lose video and my monitor goes to sleep. It's almost like my...
General Discussion
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 00:25.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App