N
N
neznaiaka2020-01-06 18:47:20
System administration
neznaiaka, 2020-01-06 18:47:20

How to set up automatic Internet reconnection in windows 10 at OS startup?

There is a configured auto-connection to the Internet through the registry, by the rasdian command. There is a .bat'nick to automatically reconnect the Internet in case of some troubles.

@echo off
set connection=Опсос
set login=ХХХ
set psw=ХХХ
set pause=2
 
:LOOP
set connected=0
for /f "delims=" %%i in ('rasdial') do (
    if "%%i"=="%connection:"=%" set connected=1
)
if %connected%==0 (
    echo %date% %time%	"%connection%" connection not detected. Dialing...
rasdial "%connection:"=%" "%login:"=%" "%psw:"=%"
ping -n %pause% 127.0.0.1>nul 2>&1
goto LOOP
) else (
    echo %date% %time%	"%connection%" connection is active.
)

Question. How to competently enter it (.bat'nickname) into this "ecosystem"? Under the condition of an unsuccessful connection to the Internet? Through the task scheduler, through autoload? Or also somehow through the registry? or even write another batch file (not mine, I can’t write another one), where all the conditions will be met. Type: OS start > connect > error > reconnect.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Korotenko, 2020-01-06
@neznaiaka

Create a task in Task Scheduler. Conditions at login or at system startup.
Although the standard dialer copes with this out of the box

C
cinquefoil2016, 2020-01-12
@cinquefoil2016

There are three options for you, the first is a batch file in the scheduler, as advised above, but you can also do it through editing the registry, I did this, the option is working. The third option is to create a service, so take your pick. More details in the instructions .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question