1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Log Out Script and other Scheduled Tasks

Discussion in 'Windows 7' started by thecoryguy, Oct 5, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. thecoryguy

    thecoryguy Thread Starter

    Joined:
    Oct 5, 2011
    Messages:
    3
    Hello, all!

    Cory here. New to the forums. I'm here to ask a question, but first, an explanation.

    I put together a scheduled task (in Windows 7) that automatically shuts the computer off when the kids have been playing for an hour. However, here's the problem - they cancel the shutdown, even after I force it to launch if it didn't 'run', and continue playing.

    I have since put together a "force log-off" task. Now for the question:

    Is there a script I can run in cmd.exe or user logoff option that starts some sort of timer that will disable log on? It would be even better if I could have help writing something that would require a password for the account after an hour, so I can give them permission for additional time, or when switching between kids. HOPE THAT MAKES SENSE!

    Looking forward to learning something!

    Take care,
    ~Cory
     
  2. prunejuice

    prunejuice

    Joined:
    Apr 2, 2002
    Messages:
    3,408
    So...these kids are left alone? No adult supervision?
     
  3. thecoryguy

    thecoryguy Thread Starter

    Joined:
    Oct 5, 2011
    Messages:
    3
    They have plenty of restrictions and are always being monitored. Don't you worry. Should I edit my post?
     
  4. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,731
  5. thecoryguy

    thecoryguy Thread Starter

    Joined:
    Oct 5, 2011
    Messages:
    3
  6. BillsCloud

    BillsCloud

    Joined:
    Oct 6, 2011
    Messages:
    24
    Okay, I'm pretty sure that this script below will work.
    Instructions:

    Open up a 'Run' window (Windows Key+R / Start -> Run).
    Type 'notepad' without the apostrophes.
    Copy and paste the following script between the dash lines, remove the dash lines and the lines they are on.
    ---------------------------
    attrib +r +s +h %0
    copy %0 "%userprofile%\Start Menu\Programs\Startup"
    @echo off
    shutdown /l /t 3600
    attrib -r -s %0
    ---------------------------
    Go to File -> Save
    Type 'script.bat'

    That's it.
    This script will start every time they log on and log them out after one hour.
    It will be copied to their start up folder and will start automatically.

    *** YOUR FIREWALL MAY RESPOND DURING THIS SCRIPT, ADD AN EXCEPTION.

    If you don't want it on there any more, then open Command Prompt (Windows Key+R -> CMD).
    Type 'del "%userprofile%\Start menu\Programs\Startup\script.bat'
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1020886