A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections.
@echo off
rem - ПУТЬ МЕНЯЕМ В 3 МЕСТАХ!!!
set RoadWay=C:\test
echo "Пошла ЖАРА:" > %RoadWay%\log.log
SetLocal EnableExtensions EnableDelayedExpansion
FOR /R "%RoadWay%\" %%G in (.) DO (
Pushd %%G
@rem Надо doc потому что учитывается doc и docx - по шаблону
for %%A IN (*.doc) DO (
set FullPath=%%~dpA
set cut=!FullPath:~0,-1!
for %%j in (!cut!) do set ParentDir=%%~nxj
echo !ParentDir!
for /f "tokens=1* delims= " %%B IN ("%%~nA") DO (
If Not Exist "..\%%~B" Md "..\%%~B" >nul 2>&1
IF Not Exist "..\%%~B\%%A" ( xcopy /K /y "%%A" "..\%%~B\"
echo %DATE%-%TIME% Скопировали "%%~A" в "..\%%~B\%%~A" >> %RoadWay%\log.log
) ELSE (
@echo Одинаковый файл - %%A
@echo Переименовали - %%~nA_!ParentDir!%%~xA
ren "%%A" "%%~nA_!ParentDir!%%~xA"
xcopy /K /y "%%~nA_!ParentDir!%%~xA" "..\%%~B\"
echo %DATE%-%TIME% Скопировали "%%~nA_!ParentDir!%%~xA" в "..\%%~B\%%~nA_!ParentDir!%%~xA" >> %RoadWay%\log.log
)
)
)
Popd
)
pause
$VpnName = "Тест проверка TEST"
$gateway = "8.8.8.8"
$psk = "123456"
$regp = 'HKLM:\SYSTEM\CurrentControlSet\Services\PolicyAgent' #if VPN server is behind NAT, otherwise comment out this line.
#add l2tp vpn
Add-VpnConnection -Name $VpnName -ServerAddress $gateway -TunnelType L2tp -AuthenticationMethod MSChapv2 -EncryptionLevel Optional -L2tpPsk $psk -Force -AllUserConnection -RememberCredential -SplitTunneling
New-ItemProperty -Path $regp -Name AssumeUDPEncapsulationContextOnSendRule -Value 2 -PropertyType 'DWORD' -Force