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?
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?











