Applicable platform: WINDOWS 2k/xp Home/pro
Applicable environment: directory sharing or Printer sharing, often due to the maximum connection of 10 people, and can not provide normal file and print sharing services to others
Workaround:
1, Pro version of the system, modify Group Policy secpol.msc/Local Policy/security options/The time required before suspending the session, change to 1 minutes
2, use the following script, every 30 seconds (or custom interval) to clear access to the connection
Copy Code code as follows:
@echo off
REM defines the cycle interval:
Set secs=30
Echo.
echo ============================================
echo = = = This script automatically disconnects some access when it is up to the upper limit of computer share access and uses = =
Echo = = To run a script = =
Echo = = Query for every%secs% of seconds, and perform purge command = =
Echo ============================================
Echo.
Net session >nul | | goto:error
: BEGIN
Set clear=0
Echo.
for/f "tokens=1,2"%%i in (' Net sessions ^| find '/') does (
net session%%i/delete/y >nul 2>&1 >set clear=1
Echo%time:~0,8% clear Access Source:%%i [%%j]
)
Echo.
If%clear%==0 (the Echo%time:~0,8% now has no access to this computer,%secs% seconds later ...
) Else (Echo%time:~0,8% cleared,%secs% seconds later ...)
Ping 127.0.0.1-n%secs%-W 0 >nul 2>&1
Goto begin
: Error
Echo permissions are not sufficient to perform, please contact your administrator.
Echo.
Pause >nul 2>&1 |echo Please press any key to close ...