ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > Living Room

log users off at a certain time using task scheduler

(1/3) > >>

techidave:
I have been trying to use the shutdown in a batch file to log a user off at a certain time but am having difficulties getting the switches right.  I am using shutdown -c-l 300 -m "Time restrictions are now forcing you to logoff in 5 minutes; please save all your work."  But the problem with this is it defaults to 60 seconds instead of 5 minutes.  It also grays out the option to cancel which is what I want.  If I reverse the c and l switch then it will do the 5 minutes but the cancel button is now active.  All I want it to do is log them off but this will shut the computer down instead. 

The l switch is suppose to log off only and if I remove the m switch then i cannot get the 5 minutes and it shutsdown.

Any ideas on how to fix this?  Maybe this could be a coding snack?

jgpaiva:
Now i'm confused... What OS do you have?

My win xp pro sp2 doesn't have the -m switch, and the -c switch is for adding a comment to the shutdown dialog...

techidave:
I have XP SP2.  I downloaded the shutdown utility from Beyond Logic Shutdown http://www.beyondlogic.org/solutions/shutdown/shutdown.htm

jgpaiva:
Ok, now i understand.
It's a shame that the default "shutdown" utility that comes with windows doesn't allow you to logoff and have a timeout.

There are a few shutdown utilities that i'm sure are able to do this...

What exactly would you like to do? have the system display a message indicating that the computer will log of in X minutes, right?

techidave:
that is correct.  I have set up restrictions using the net user routine but it won't log them off if they are already logged in.  So lets say I have "son" set to end at 9pm and would like for the logoff utiltiy to run at say 9:05pm and then in 5 minutes it would log him off at 9:10pm.

is this doable?

Navigation

[0] Message Index

[#] Next page

Go to full version