Applicable platform: WINDOWS 2 K/xp home/PRO
Applicable environment: Directory sharing or printer sharing. Files and print sharing services cannot be provided to others due to the connection limit of 10 users.
Solution:
1. In the PRO version, modify the Group Policy secpol. msc/Local Policy/security options/the time required before the session is suspended to 1 minute.
2. Use the following script to clear the access connection every 30 seconds (or custom interval ).Copy codeThe Code is as follows: @ echo off
Rem defines the cycle interval:
Set secs = 30
Echo.
Echo ===================================================== =====
Echo = This script is used when the computer shared access reaches the Upper Limit =
Echo = some access connections are automatically disconnected after the script is run =
Echo = query every % secs % seconds and run the clear command =
Echo ===================================================== =====
Echo.
Net session> nul | goto: error
: Begin
Set clear = 0
Echo.
For/f "tokens = 1, 2" % I in ('net session ^ | find "/" ') do (
Net session % I/delete/y> nul 2> & 1
Set clear = 1
Echo % time :~ 0, 8% clear access Source: % I [% j]
)
Echo.
If % clear % = 0 (echo % time :~ 0, 8% no access to this computer, % secs % seconds later continue...
) Else (echo % time :~ 0, 8% cleared, % secs % seconds later ...)
Ping 127.0.0.1-n % secs %-w 0> nul 2> & 1
Goto begin
: Error
The echo permission is insufficient and cannot be executed. Contact the administrator.
Echo.
Pause> nul 2> & 1 | press any key to disable echo...