<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; CMD/BAT: Не работает скрипт - VPN соединение]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10491&amp;type=atom" />
	<updated>2015-03-12T14:00:03Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=10491</id>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Не работает скрипт - VPN соединение]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92485#p92485" />
			<content type="html"><![CDATA[<p>Решил я проблему. Надо было укказать: <strong>find &quot;IP&quot;</strong> а не <strong>find &quot;IP Address&quot;</strong>.</p><div class="codebox"><pre><code>D:\Admin&gt;VPN.bat
Connecting to VPN...
Verifying username and password...
Registering your computer on the network...
Successfully connected to VPN.
Command completed successfully.

 :\Admin&gt;set GETIP= 172.23.241.95

D:\Admin&gt;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[eXtremer]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32925</uri>
			</author>
			<updated>2015-03-12T14:00:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92485#p92485</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Не работает скрипт - VPN соединение]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92484#p92484" />
			<content type="html"><![CDATA[<p>Какбэ, а суть в чем? Найти айпишник? Ищите через реестр, например так:<br /></p><div class="codebox"><pre><code>@echo off
  setlocal
    ...
    set &quot;key=HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces&quot;
    for /f &quot;tokens=3&quot; %%i in (
      &#039;reg query %key% /s ^| findstr /irc:&quot;dhcpip&quot;&#039;
    ) do set &quot;ip=%%i&quot;
    ...
  endlocal
exit /b</code></pre></div><p>Это в самом простом случае.</p>]]></content>
			<author>
				<name><![CDATA[greg zakharov]]></name>
			</author>
			<updated>2015-03-12T13:52:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92484#p92484</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[CMD/BAT: Не работает скрипт - VPN соединение]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92480#p92480" />
			<content type="html"><![CDATA[<p>У меня есть пользователи который до сих пор используют Windows XP, для них я нашел/переделал код ниже, потому что в тот момент у меня небыло машина с Windows XP на руках, я тестил на Windows Server 2003, код работал без вопросов, теперь при попытке воспроизвести тот же код на машине Windows XP, к сожалению код не работает. Помогите пожалуйста ешить проблему.<br />Объясняю зачем мне нужен этот код, шлюз каждый раз меняется (динамический) и мне сначало нужно узнать какой IP будет у шлюза перед тем как создать маршрут.</p><div class="codebox"><pre><code>@rasdial VPN username password
@setlocal
@for /f &quot;tokens=1-2 delims=:&quot; %%i in (&#039;ipconfig ^| find &quot;IP Address&quot; ^| find &quot;172.23&quot;&#039;) do set GETIP=%%j
@route add 172.30.255.0 mask 255.255.255.0 %GetIp%
@endlocal</code></pre></div><p>Host: 172.30.255.22<br />Gateway/Шлюз: один случайный IP из данного диапазона 172.23.241.2-172.23.241.254</p><p>Спасибо.</p><p>*Не забываем что речь идет о Windows XP, в Windows 7 и выше это решается горазда легче.</p>]]></content>
			<author>
				<name><![CDATA[eXtremer]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32925</uri>
			</author>
			<updated>2015-03-12T07:32:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92480#p92480</id>
		</entry>
</feed>
