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


  1. Posts : 1
    Windows 7 Home Editon - Windows 10 Proffesional Build 10130
       #1

    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,
    linuxfan1



    Code: Click me
      My Computer


  2. Posts : 5,656
    Windows 7 Ultimate x64 SP1
       #2

    You should re-attach that file here Screenshots and Files - Upload and Post in Seven Forums
      My Computer


  3. Posts : 6,285
    Windows 10 Pro X64
       #3

    This is what linuxfan1 posted:

    Code:
    @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
     start C:\Windows\explorer.exe
     taskkill /pid cmd.exe
    Also need logoff.bat which was not posted.
      My Computer


  4. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #4

    Ztruker said:
    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
    Code:
    if %M%==* shutdown /l
    instead?

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


 

  Related Discussions
Our Sites
Site Links
About 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 05:01.
Find Us