Link to home
Start Free TrialLog in
Avatar of atkfrg56
atkfrg56

asked on

Have a PC automatically shutdown after 10 minutes of inactivity under Any Windows XP User.

In windows xp, how can i have the computer shutdown after 10 minutes or such of inactivity. The computer will most likely be at the 'log in' screen...so there is not a user logged in. The Windows power options are per-user...not per machine as far as I can see. My BIOS does not support auto-shutdown or standby either, mainly because its a desktop computer and not a laptop. Any suggestions on how to make my computer shutdown, anytime after 10 minutes of no usage?

Thx
Avatar of SheharyaarSaahil
SheharyaarSaahil
Flag of United Arab Emirates image

Hello atkfrg56 =)

Q:  How can I auto logoff or automatically log a user out of Windows after a period of inactivity?

A:  This can be done in Windows 2000 / XP / .NET using Group Policy. Control Panel, Administrative Tools > local security policy > local policies \ security options \ "Automatically log off users" and/or "Amount of idle time required before disconnecting session"

ref >> http://securityadmin.info/noframes/faqget.asp#autologoff
ASKER CERTIFIED SOLUTION
Avatar of mansnes
mansnes

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of atkfrg56
atkfrg56

ASKER

I asked to shutdown...not log off. Is there a way to make it shutdown instead of logging off?
mansnes,
That looks like a good idea. I am going to try that tonight and let you know how it went. thx
read here about Terminator >> http://www.cybercom-software.com/freestuff.htm

Users hogging computers? Kids staying on the Internet too long? With Terminator, you can restrict the amount of time users can spend on a PC. You can set the PC to automatically logout, reboot or shutdown at a specific time each day (eg. 5:30pm), or you can set it to logout, reboot or shutdown after a set period of time (eg. 60 minutes).  Simple to setup and run, Terminator is invisible to users - they won't even know it is running.

* Logout, Reboot or shutdown your PC at a specified time, or after an elapsed period of time
* Optional forced exit mode will force non-compliant applications to close
* Password protected
* Enable or disable automatic startup when Windows starts
* Shut down instances of Terminator
* Dynamic updating of settings when Terminator is already running
* Runs on Windows 95/98/Me/NT/2000/XP
mansnes,
omgwhee!!!111!1!! that scheduler idea works perfectly. now thats what i call laying down a thick helping of ownership. awesome, thanks!
Right on!  glad it solved your problem...

Ownage!  :)
Here it goes :
> Right click on your desktop
> choose properties
> go to the screen-saver tab
> on that screen you will find "power managment"
> go on and on the new screen you will find settings that can set your computer to shut down after certain of time


as well, there are some nice small applets that handle power managment
and are much more dynamic then the integral windows power-managment

on these programs you can set for example a constant time in the day that your computer will
shut down or will turn-on

you can as well program it to turn on and then play your favorite MP3 as an alarm clock
neat :D
Hello mansnes,
I tried using your code in Windows 2000 and I get a little window appears when the comp tries to run the script:

Windows Script Host

Script: C:\scripts\shutdown.vbs
Line: 2
Char: 5
Error: Expected Statement
Code: 800A0400
Source: Microsoft VBScript complation error

The code I used was
Set colOperatingSystems = GetObject_
    ("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem")
 
For Each objOperatingSystem in colOperatingSystems
    ObjOperatingSystem.Win32Shutdown(1)
Next

I saved the file as shutdown.vbs in C:\scripts\ and in c:\winnt\

Also I dont fully understand what you mean by:

"Then set your scheduled task to be cscript.exe shutdown.vbs.  Optionally, you can just use the whole path to the script in the scheduled task, i.e. cscript.exe c:\scripts\shutdown.vbs"

I have to select an executable or some sort of a file or at the very least, type the path to the executable or file. The OS just rejects commands like "cscript.exe c:\scripts\shutdown.vbs"
(No inverted commas), it will try to put c:\ in front of that.

All help is appreciated,
~User X
You could change to code to:
----------
Set colOperatingSystems = GetObject ("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem")
 
For Each objOperatingSystem in colOperatingSystems
    ObjOperatingSystem.Win32Shutdown(1)
Next
----------


Change command to c:\windows\system32\cscript.echo c:\scripts\shutdown.vbs
UserX:
Ok, I just copied the text from your posting above, except I consolidated the first statement into a single line (removing the underscore):

Set colOperatingSystems = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem")

And I saved all four lines in the WINNT folder on a Windows 2000 system as shutdown.vbs.  Then I went and created a dummy scheduled task.  To do that, I just bypassed the wizard by right clicking in the Scheduled Tasks window and chose New->Scheduled Task from the contextual menu.  I then opened the Properties of the task and for the Run field I just typed in "cscript.exe shutdown.vbs" (without the quotes).  In the Start In field I put "C:\WINNT" (again, no quotes, but it really doesn't matter).  I entered valid credentials and scheduled the task and it ran fine - the system shut down.  I'm guessing there was some problem with script execution parsing the underscore, which should be read as "this line is continued on the next line".  Try it all on one line like I just wrote here.

My statement about the path was just if you had saved shutdown.vbs somewhere that wasn't in the system path.  The system path is the default places Windows looks for stuff without having to be told specifically.  The system path lets you do things like type in just cmd.exe instead of c:\winnt\system32\cmd.exe to get a command prompt because c:\winnt\system32 is in the system path.  So if you saved shutdown.vbs in the c:\scripts folder, you would have to use "cscript.exe c:\scripts\shutdown.vbs" - get it?
Got it, i will try to implement this solution later.
I managed to download shutdown.exe which is performing the same function, the system shuts itself down at 7 every morning.

~User X
I don't know if anyone has posted this already but:
Go onto control panel (preferably on classic view) click on system
click on power options, then click on where it says:
turn off hard disks in: ....
enter 10 mins or whatever time you want
then if you want, do the same to the monitor
click OK
I hope this was helpsul to you
oops:
2 problems with my above post:
1 - Someone already posted that
2 - It doesnt shut off when theres no usage it just shuts off at that time
umm yeh.. if nobody else has mentioned this....

Only system admins (people in the administrative group) now have the rights to change the power settings. Yes, you can change them under a normal user, but guess what? The system doesn't save the reg change when you log off.

So in reality if you log in as admin set the power settings to what you want then vola! They stay set to the admin's profile settings. Now if everyone is a admin.. then I don't understand your question. Even if it is set as a script to run shutdown.exe they could still pause or delete the task.