Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need more persistant 'shutdown -f' command

Status
Not open for further replies.

PinkeyNBrain

IS-IT--Management
Dec 12, 2006
279
US
According to the help screens 'shutdown -f' should close open apps without warning. I'm running into the following scenario:
1) Open accessories->paint and make some change
2) Open a cmd prompt and issue "shutdown -f"
3) I'll get asked if I want to save the 'paint' program.
4) If I respond 'cancel' it appears to negate the 'shutdown' request.

Is there an extra (undocumented?) parameter that will truly force the PC to shutdown.

Need: I've written a fairly simple program that gives my kids a limited amount of time on the PC per day (it's activated through Start->Programs->Startup). Once the time is used up I want the PC to shut down. It worked great for about a year until one of them figured out the basics of the above scenario.

OS: WinXP Pro SP3
 
Wizmo will shut down the PC and ignore open program warnings if you pass it the correct syntax.



Taken from that site:
The 'Damit' Variations
Most Windows users have had the annoying experience (all too often) of having Windows decide that it just doesn't feel like shutting down, rebooting, restarting, sleeping, hibernating or whatever. To address Windows occasional lack of obedience, I added a handy (and sometimes crucial) feature: The shutdown trigger commands list above accept an optional exclamation point "!". For example: "reboot!" (pronounced "Reboot Damit!"). A word of caution: Since the Damit Variations force the requested function to succeed, even if programs or device drivers have refused to give Windows their permission to be shutdown, you should be certain that this is what you want and that any files are safely saved.
 
HKCU\Control Panel\Desktop\AutoEndTasks - that's the one I was looking for.

The above regedit mod will address the issue much quicker but reading over the wizmo web page did get me to thinking about better ways to address this. Found a couple of commands 'tasklist' and 'taskkill' that have a lot of potential. Since my goal is to limit game time and not attempts to use the PC for scholastic purposes (I did see it happen once), I'll end up modifying my timer prog to scan for and run timers against games. When the their time is up, I can target kill the game. (FWIW - Not being a complete hard-case, the program pops up a window at the 5min mark suggesting that the user should save their game) ... for now, AutoEndTasks will win out.

Thanks all for the input.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top