Jump to content

Force Logoff


Recommended Posts

Hello, I want to know if it's possible to FORCE a logoff for the user that is using the PC . So all he has to do is click on a shortcut and he will be logedoff fast and without having to save or close runing applications .

How can this be done ? Maybe using a batch file, command line, script, anything . Please try to help me with this . Thank you in advance . Have a good day all

Link to comment
Share on other sites

Batch command:

shutdown -s -t 30

-s means shutdown ( you can also use -r for restart, -l for logoff) and the -t 30 means 30 seconds. This will terminate anything that has not closed, and initiate the shutdown in 30 seconds, regardless of what is running.

You can also abort ANY shutdown command using;

shutdown -a

This site may help:

http://www.robvanderwoude.com/index.html

Link to comment
Share on other sites

Hello, sorry fot the late reply . I had some problems at home. Thank you for the help... but it does not help. I already tryed all commands, but it's not what I want . Open for example notepad, type in something, don't close it and write in the command shell this : shutdown -s -f (this will force shutdown) . It will close all apps, but it will stop on NOTEPAD and ask you if you want to save ... If you press cancel , the shutdown is canceled

I need something that will not stop on this, and logoff no matter what . What do you say ? How can it be done ?

Link to comment
Share on other sites

According to the online help for the shutdown command if you use the /f option it will "Force running applications to close. This will not prompt for File-Save in any open applications. so will result in a loss of all unsaved data!!!" Sounds just like what you're looking for. So the whole command should look like this

shutdown /s /f

if you want you can just make a shortcut point to

C:\Windows\System32\shutdown.exe /s /f

that way you don't need to make a batch file and then make a shortcut to the batch file. Make sure to use Windows or WinNT depending on which version of Windows you're using. If you're unsure just open up your C drive and see which folder is there.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy