How do I disconnect a shared connection with batch processing?

Updated on technology 2024-04-04
10 answers
  1. Anonymous users2024-02-07

    Automatically disconnect network share access with batch processing Available on: Windows 2K XP Home Pro

    Applicable environment: Directory sharing or printer sharing often fails to provide file and print sharing services to others because the connection limit of 10 people is reached.

    Solution: 1. In the Pro version of the system, change the time required before suspending the session to 1 minute for the local policy of Group Policy and the security options of the local policy.

    2. Use the following script to clear the access connection every 30 seconds (or a custom interval):

    echo off

    set secs=30

    echo == This script is used after the computer sharing access limit has reached ==

    echo == Some access connections are automatically disconnected after running the script ==

    echo == every %secs% seconds and execute the purge command ==

    echo ****************************************====

    session >nul ||goto :error

    beginset clear=0

    f "tokens=1,2" %%i in ('net session ^|find "\"') do (

    net session %%i /delete /y >nul 2>&1

    set clear=1

    clear%==0 (echo %time: 0,8% no one is accessing this computer at the moment, %secs%seconds to continue.

    else (echo %time: 0,8% cleared, %secs%seconds to continue.)

    ping -n %secs% -w 0 >nul 2>&1

    goto begin

    nul 2>&1 |echo Please press any key to turn off.

  2. Anonymous users2024-02-06

    echo off

    set secs=30

    echo == This script is used after the computer sharing access limit has reached ==

    echo == Some access connections are automatically disconnected after running the script ==

    echo == every %secs% seconds and execute the purge command ==

    echo ****************************************====

    session >nul ||goto :error

    beginset clear=0

    f "tokens=1,2" %%i in ('net session ^|find "\"') do (

    net session %%i /delete /y >nul 2>&1

    set clear=1

    clear%==0 (echo %time: 0,8% no one is accessing this computer at the moment, %secs%seconds to continue.

    else (echo %time: 0,8% cleared, %secs%seconds to continue.)

    ping -n %secs% -w 0 >nul 2>&1

    goto begin

    nul 2>&1 |echo Please press any key to turn off.

  3. Anonymous users2024-02-05

    The upstairs is not considered to be connected and disconnected with a command, in fact, it can work without vb The disconnect command is: rasdial broadband connection disconnect (where the broadband connection is the name of the connection, if your broadband connection name is something else, change it yourself) The command of the connection is: rasdial broadband connection username password) (broadband connection is the same as above, the username and password are the username and password when you adsl dial) The suffix is changed to.

    cmd or is. bat

  4. Anonymous users2024-02-04

    Thank me! o( oHa!

    rasdial [entryname] disconnect commands the user to disconnect the broadband connection, if there is only one broadband connection name, you can omit [entryname], i.e. omit the broadband connection name, disconnect heavy don't forget to add. If there are more than one broadband connection, the broadband connection name must be written.

  5. Anonymous users2024-02-03

    No, I don't remember that I had a QQ office automatic application, and the automatic application machine has this function on the Internet.

  6. Anonymous users2024-02-02

    Suppose a remote computer folder is mapped to a local disk z:

    You can use the following command to disconnect this connection:

    net use z: /delete

  7. Anonymous users2024-02-01

    Is it wired or wireless? If there is a wired network, the router is directly connected, do not enter the password, plug in the network cable and you can directly connect to the Internet?

  8. Anonymous users2024-01-31

    Create a new task plan directly in Start--Program--Attachment--System Tools--Task Plan, select your bat file in the running of the task, and then click the plan button to switch to the plan window, click on the advanced inside, and set it to execute once in less than 60 minutes.

  9. Anonymous users2024-01-30

    It is recommended to use the task scheduling function of the win system directly.

  10. Anonymous users2024-01-29

    @echo off

    Set the server IP

    set serverip=

    Set a username and password.

    set user=

    set pwd=

    Establish sharing. When you establish a connection to the server, you can also determine whether the server can be pinged before establishing a connection, and add logs.

    net use \\serverip%\a "%pwd%" /u:%user%

    Turn on sharing. start /wait "" \\serverip%\a

    echo automatically disconnects the unit from the network when the window is closed, sorry, Bill Gates hasn't done this yet, however, you can use the following command to disconnect.

    pause: Disconnects from %serverip%.

    for /f "tokens=2,3" %%i in ('net use^|find "%serverip%"')do net use %%i /del /y 2>nul & net use %j /del /y 2>nul

    pause

Related questions
12 answers2024-04-04

:** automatically creates catalogs based on the date they were last modified for categorization. >>>More

10 answers2024-04-04

attrib c: windows system32 +h, pay attention to the spaces. >>>More

7 answers2024-04-04

I don't quite understand your question, so please ask you a few questions. >>>More

10 answers2024-04-04

Nowadays, it is very convenient to use a shared car in the city, but many people do not know what to do if they violate the law. First, let's take a look at the car-sharing violation handling process. >>>More

25 answers2024-04-04

1. Personal or commercial properties will be parking spaces in advance. >>>More