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 ).
@ 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...