none
How to kill a user or process that had been idle state over a long time in windows OS? RRS feed

  • 问题

  • Due to the limit resource of OS, I have to figure out solutions to accelerate system.

    Kill idle users or processes that had not any input during a long time is the way to save OS resources.

    When I use the cmd command line: query user, I can find some users are in idle state.

    Is there have some dear friends can share some good solutions to solve this problem, thank you very much.

    2019年10月12日 8:11

答案

  • Hi, thanks for your wait.

    I have to recommend a very effective tool, idlelogoff.exe, it can be download from here:

    All of follow steps have to do under Administrator role.

    Automatically logoff inactive users part in Crystal Shen's essay, there has a download link, please go upstairs to check out.

    If the user want to use it to manage all of users on server after every user is log in, can do as follows:

    1.Open C disk, put the idleoff.exe on C disk root, and create a new bat file, its name can be set as SeverAc.bat, content in this bat file can write like this:

    @echo off

    :start

    cd :c\

    idlelogoff.exe 60 LOGOFF

    choice /t 40 /d y /n >nul

    goto start

    2.Open the path:C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

    3.Create a new vbs file under step2, name can be set as server.vbs, the vbs file content can write like this:

    set ws=WScript.CreateObject("WScript.Shell")

    ws.Run "C:\ServerAc.bat",0

    After these three steps were did, inactive users will automatically logoff after set time, in this example:

    1. In step1, 60 means after 60 seconds inactive users will be loged off by OS system, different users can set different time.

    40 means bat file will be run every 40 seconds, different users can set different time.

    2.The reason of use a vbs file to control a bat file is that cmd command window will be invisible after start.

    In this way, we can keep the prgram can run all the time and avoid the manage program is stopped by common users.

    If any friend have more excellent program to share, warmly welcome your better solution!





    2019年10月23日 7:12

全部回复

  • I think the solutions should be through command line script or some other program.

    Because there has a lot of machines need to manage, efficiency is very important.

    2019年10月12日 8:27
  • Hi,

     

    From your description, I know you want script to kill idle users or processes. For script, we are not familiar, But we will try our best to help you.

     

    After doing a lot of research, we find some scripts may be helpful to us. You can read it as a reference:

     

    stop a program after 30 minutes of inactivity?

    https://social.technet.microsoft.com/Forums/windowsserver/en-US/199aa090-13cd-4c72-9743-951497745096/stop-a-program-after-30-minutes-of-inactivity?forum=winserverpowershell

     

    Terminate a process after inactivity of computer inputs

    https://gallery.technet.microsoft.com/Terminate-a-process-after-ebb4fe2c

     

    Log off idle disconnected users

    https://gallery.technet.microsoft.com/scriptcenter/Log-off-idle-disconnected-684fe6dc

     

    Automatically logoff inactive users

    http://www.intelliadmin.com/index.php/2011/11/automatically-logoff-inactive-users/

    Note: This is Third party website, just for your reference.

     

    Hope it can help.

     

    Best regards.

    Crystal


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    2019年10月14日 1:47
  • Hi,

    How's everything going? If there's anything else we can help, feel free to let us know.

    best regards.

    Crystal


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    2019年10月17日 6:05
  • Hi, thanks for your wait.

    I have to recommend a very effective tool, idlelogoff.exe, it can be download from here:

    All of follow steps have to do under Administrator role.

    Automatically logoff inactive users part in Crystal Shen's essay, there has a download link, please go upstairs to check out.

    If the user want to use it to manage all of users on server after every user is log in, can do as follows:

    1.Open C disk, put the idleoff.exe on C disk root, and create a new bat file, its name can be set as SeverAc.bat, content in this bat file can write like this:

    @echo off

    :start

    cd :c\

    idlelogoff.exe 60 LOGOFF

    choice /t 40 /d y /n >nul

    goto start

    2.Open the path:C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

    3.Create a new vbs file under step2, name can be set as server.vbs, the vbs file content can write like this:

    set ws=WScript.CreateObject("WScript.Shell")

    ws.Run "C:\ServerAc.bat",0

    After these three steps were did, inactive users will automatically logoff after set time, in this example:

    1. In step1, 60 means after 60 seconds inactive users will be loged off by OS system, different users can set different time.

    40 means bat file will be run every 40 seconds, different users can set different time.

    2.The reason of use a vbs file to control a bat file is that cmd command window will be invisible after start.

    In this way, we can keep the prgram can run all the time and avoid the manage program is stopped by common users.

    If any friend have more excellent program to share, warmly welcome your better solution!





    2019年10月23日 7:12
  • Hi,

    Thanks for sharing the detail steps. I am glad that our information can help. if there's anything else we can help in the future, feel free to post in our forum.

    Have a nice day!

    Best regards.

    Crystal


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    2019年10月24日 5:04