<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; WSH: Как узнать  ip модема?]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=9848</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=9848&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «WSH: Как узнать  ip модема?».]]></description>
		<lastBuildDate>Fri, 01 Aug 2014 05:43:20 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: WSH: Как узнать  ip модема?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85527#p85527</link>
			<description><![CDATA[<p><a href="http://forum.script-coding.com/viewtopic.php?id=6148">В этой теме</a> ссылка на последнюю версию AHK_L. Там при установке идёт в комплекте документация на английском.</p><p>У меня в подписи ссылка на старый сайт, там предыдущая версия AHK (которую теперь зовут AHK basic, или AHK classic).<br />Также ссылка на наш сайт, где можно посмотреть документацию на русском онлайн или скачать CHM-файлом.</p><p>В Вашем случае будет как-то так:<br /></p><div class="codebox"><pre><code>Run, rasdial megafon, , Hide ; Параметр Hide скрывает окно запущенной программы
Sleep, 5000 ; Ждём пять секунд установку связи
;Здесь можно проверить, что соединение прошло удачно
Run, route add 88.12.12.12 MASK 255.255.255.255 %A_IPAddress2%  METRIC 1, , Hide</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Fri, 01 Aug 2014 05:43:20 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85527#p85527</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Как узнать  ip модема?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85526#p85526</link>
			<description><![CDATA[<div class="quotebox"><cite>ypppu пишет:</cite><blockquote><div class="codebox"><pre><code>Run, здесь пишется всё то же, что и в командной строке</code></pre></div></blockquote></div><p>благодарю<br />,подскажите литературку для изучения AutoHotkey <br />буду признателен.</p>]]></description>
			<author><![CDATA[null@example.com (selevo)]]></author>
			<pubDate>Fri, 01 Aug 2014 03:10:32 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85526#p85526</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Как узнать  ip модема?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85525#p85525</link>
			<description><![CDATA[<div class="codebox"><pre><code>Run, здесь пишется всё то же, что и в командной строке</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Thu, 31 Jul 2014 19:59:27 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85525#p85525</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Как узнать  ip модема?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85524#p85524</link>
			<description><![CDATA[<p>а как теперь мне сделать аналог&nbsp; route add<br /> что-то типа<br />route add 88.12.12.12 MASK 255.255.255.255 %A_IPAddress2%&nbsp; METRIC 1</p><p>?</p><p>пол часа убил&nbsp; на&nbsp; справку&nbsp; по AutoHotkey <br />очень замудрёный скриптовый язык</p>]]></description>
			<author><![CDATA[null@example.com (selevo)]]></author>
			<pubDate>Thu, 31 Jul 2014 18:10:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85524#p85524</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Как узнать  ip модема?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85523#p85523</link>
			<description><![CDATA[<p>понял,тестирую...</p>]]></description>
			<author><![CDATA[null@example.com (selevo)]]></author>
			<pubDate>Thu, 31 Jul 2014 17:15:14 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85523#p85523</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Как узнать  ip модема?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85514#p85514</link>
			<description><![CDATA[<div class="quotebox"><cite>selevo пишет:</cite><blockquote><p>AutoHotkey <br />тоже подходит для начального понимания работы<br />но&nbsp; ip модема во второй строчке кстати<br />10.248.156.57</p></blockquote></div><p>Я не совсем об этом. Вот Вы устанавливаете соединение с Мегафоном. При этом появляется интерфейс WAN (PPP/SLIP) Interface. Следующий код отображает IP-адреса первых четырех сетевых адаптеров в компьютере:<br /></p><div class="codebox"><pre><code>MsgBox, %A_IPAddress1% `r`n A_IPAddress2 `r`n A_IPAddress3 `r`n A_IPAddress4</code></pre></div><p>Если число сетевых адаптеров (физических и виртуальных) на компьютере неизменно, то IP-адрес модема всё время будет в одной переменной (к примеру, %A_IPAddress3%). Тогда всё просто.<br />И даже если число адаптеров меняется, код не сильно усложнится.</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Thu, 31 Jul 2014 13:09:23 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85514#p85514</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Как узнать  ip модема?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85509#p85509</link>
			<description><![CDATA[<p>Кстати, в команде &quot;route print&quot; ведь можно и указать адрес, типа:<br /></p><div class="codebox"><pre><code>
&gt; route print -4 10.24*
</code></pre></div><p>А вывод команды &quot;route print&quot; можно тут же в батнике пропарсить командой FOR - если такое интересно, то поможем/подскажем.</p>]]></description>
			<author><![CDATA[null@example.com (Rom5)]]></author>
			<pubDate>Thu, 31 Jul 2014 12:51:55 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85509#p85509</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Как узнать  ip модема?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85505#p85505</link>
			<description><![CDATA[<div class="quotebox"><cite>selevo пишет:</cite><blockquote><p>выдаёт ошибку</p><p>Oшибкa: Heдoпycтимoe иcпoльзoвaниe Null: &#039;Join&#039;</p></blockquote></div><p>Хмм.<br />Вот, пример с предварительной проверкой значений перед объединением элементов в одну строку через &quot;Join()&quot; (я убрал условие віборки &quot; WHERE IPEnabled = True&quot;, т.е. увидим все имеющиеся конфигурации):</p><div class="codebox"><pre><code>
Dim objWMIService, colNicConfigs, objNicConfig
Dim strQuery, strOut

Set objWMIService = GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2&quot;)

&#039; strQuery = &quot;SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True&quot;
strQuery = &quot;SELECT * FROM Win32_NetworkAdapterConfiguration &quot;
Set colNicConfigs = objWMIService.ExecQuery (strQuery)

strOut = &quot;&quot;
For Each objNicConfig In colNicConfigs
    strOut = strOut &amp; vbCrLf &amp; &quot;--8&lt;-- (Caption) &quot; &amp; objNicConfig.Caption
    
    If IsArray(objNicConfig.DefaultIPGateway) Then
        strDefaultIPGateway = Join(objNicConfig.DefaultIPGateway, &quot;,&quot;)
        strOut = strOut &amp; vbCrLf &amp;  &quot;DefaultIPGateway: &quot; &amp; vbTab &amp; strDefaultIPGateway
    End IF
    
    strOut = strOut &amp; vbCrLf &amp;  &quot;Description: &quot; &amp; vbTab &amp; objNicConfig.Description
    
    If IsArray(objNicConfig.IPAddress) Then
        strIPAddress = Join(objNicConfig.IPAddress, &quot;,&quot;)
        strOut = strOut &amp; vbCrLf &amp;  &quot;IPAddress: &quot; &amp; vbTab &amp; strIPAddress
    End IF

    If IsArray(objNicConfig.IPSubnet) Then
        strIPSubnet = Join(objNicConfig.IPSubnet, &quot;,&quot;)
        strOut = strOut &amp; vbCrLf &amp;  &quot;IPSubnet: &quot; &amp; vbTab &amp; vbTab &amp; strIPSubnet
    End IF
    
  strOut = strOut &amp; vbCrLf &amp;  &quot;MACAddress: &quot; &amp; vbTab &amp; objNicConfig.MACAddress
    
    strOut = strOut &amp; vbCrLf
Next

MsgBox strOut,,strQuery
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Rom5)]]></author>
			<pubDate>Thu, 31 Jul 2014 12:38:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85505#p85505</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Как узнать  ip модема?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85504#p85504</link>
			<description><![CDATA[<p>AutoHotkey <br />тоже подходит для начального понимания работы<br />но&nbsp; ip модема во второй строчке кстати<br />10.248.156.57</p>]]></description>
			<author><![CDATA[null@example.com (selevo)]]></author>
			<pubDate>Thu, 31 Jul 2014 12:38:05 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85504#p85504</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Как узнать  ip модема?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85496#p85496</link>
			<description><![CDATA[<p>Если IP-адрес модема всегда находится на третьем интерфейе, то на AutoHotkey эта задача решалась бы в пару строк. В противном случае тоже можно решить, только код будет несколько длиннее.</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Thu, 31 Jul 2014 09:39:36 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85496#p85496</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Как узнать  ip модема?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85495#p85495</link>
			<description><![CDATA[<p>выдаёт ошибку</p><p>-------<br />Cцeнapий:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; d:\IP.vbs<br />Cтpoкa:&nbsp; 13<br />Cимвoл:&nbsp; 3<br />Oшибкa: Heдoпycтимoe иcпoльзoвaниe Null: &#039;Join&#039;<br />Кoд:&nbsp; &nbsp; &nbsp; &nbsp; 800A005E<br />Иcтoчник:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Oшибкa выпoлнeния Microsoft VBScrip</p>]]></description>
			<author><![CDATA[null@example.com (selevo)]]></author>
			<pubDate>Thu, 31 Jul 2014 09:17:44 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85495#p85495</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Как узнать  ip модема?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85493#p85493</link>
			<description><![CDATA[<p>Предположу, что внутренний модем виден как сетевой адаптер. Вот, попробуйте скрипт просмотра сетевых конфигураций, имеющих IP:<br /></p><div class="codebox"><pre><code>
Dim objWMIService, colNicConfigs, objNicConfig
Dim strQuery, strOut

Set objWMIService = GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2&quot;)

strQuery = &quot;SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True&quot;
Set colNicConfigs = objWMIService.ExecQuery (strQuery)

strOut = &quot;&quot;
For Each objNicConfig In colNicConfigs
  strOut = strOut &amp; vbCrLf &amp; &quot;--8&lt;-- (Caption) &quot; &amp; objNicConfig.Caption
    
  strDefaultIPGateway = Join(objNicConfig.DefaultIPGateway, &quot;,&quot;)
  strOut = strOut &amp; vbCrLf &amp;  &quot;DefaultIPGateway: &quot; &amp; vbTab &amp; strDefaultIPGateway
    
  strOut = strOut &amp; vbCrLf &amp;  &quot;Description: &quot; &amp; vbTab &amp; objNicConfig.Description
    
  strIPAddress = Join(objNicConfig.IPAddress, &quot;,&quot;)
  strOut = strOut &amp; vbCrLf &amp;  &quot;IPAddress: &quot; &amp; vbTab &amp; strIPAddress

  strIPSubnet = Join(objNicConfig.IPSubnet, &quot;,&quot;)
  strOut = strOut &amp; vbCrLf &amp;  &quot;IPSubnet: &quot; &amp; vbTab &amp; vbTab &amp; strIPSubnet
    
  strOut = strOut &amp; vbCrLf &amp;  &quot;MACAddress: &quot; &amp; vbTab &amp; objNicConfig.MACAddress
    
  strOut = strOut &amp; vbCrLf
Next
MsgBox strOut,,strQuery
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Rom5)]]></author>
			<pubDate>Thu, 31 Jul 2014 07:43:12 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85493#p85493</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Как узнать  ip модема?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85428#p85428</link>
			<description><![CDATA[<p>как это выглядит в консоли:<br /> ip модема получился 10.248.156.57 </p><div class="codebox"><pre><code>C:\&gt;rasdial
Связь с
modem
Команда успешно завершена.

C:\&gt;route print
===========================================================================
Список интерфейсов
0x1 ........................... MS TCP Loopback interface
0x2 ...00 e0 52 ab 51 c1 ...... Realtek RTL8139 Family PCI Fast Ethernet NIC - ?шэшяюЁЄ яырэшЁют?шър яръхЄют
0x3 ...1c 6f 65 60 59 17 ...... Atheros AR8131 PCI-E Gigabit Ethernet Controller - ?шэшяюЁЄ яырэшЁют?шър яръхЄют
0x20005 ...00 1e 10 1f 87 2c ...... HUAWEI Mobile Connect - 3G Network Card #2 - ?шэшяюЁЄ яырэшЁют?шър яръхЄют
===========================================================================
===========================================================================
Активные маршруты:
Сетевой адрес           Маска сети      Адрес шлюза       Интерфейс  Метрика
          0.0.0.0          0.0.0.0        10.3.15.2     10.3.15.101       20
        10.3.15.0    255.255.255.0      10.3.15.101     10.3.15.101       20
      10.3.15.101  255.255.255.255        127.0.0.1       127.0.0.1       20
   10.255.255.255  255.255.255.255      10.3.15.101     10.3.15.101       20
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
        224.0.0.0        240.0.0.0      10.3.15.101     10.3.15.101       20
  255.255.255.255  255.255.255.255      10.3.15.101               2       1
  255.255.255.255  255.255.255.255      10.3.15.101     10.3.15.101       1
  255.255.255.255  255.255.255.255      10.3.15.101           20005       1
Основной шлюз:           10.3.15.2
===========================================================================
Постоянные маршруты:
  Отсутствует

C:\&gt;rasdial modem
Установка связи с MODEM...
Проверка имени и пароля пользователя...
Регистрация компьютера в сети...
Установлена связь с MODEM.
Команда успешно завершена.

C:\&gt;route print
===========================================================================
Список интерфейсов
0x1 ........................... MS TCP Loopback interface
0x2 ...00 e0 52 ab 51 c1 ...... Realtek RTL8139 Family PCI Fast Ethernet NIC - ?шэшяюЁЄ яырэшЁют?шър яръхЄют
0x3 ...1c 6f 65 60 59 17 ...... Atheros AR8131 PCI-E Gigabit Ethernet Controller - ?шэшяюЁЄ яырэшЁют?шър яръхЄют
0x20005 ...00 1e 10 1f 87 2c ...... HUAWEI Mobile Connect - 3G Network Card #2 - ?шэшяюЁЄ яырэшЁют?шър яръхЄют
0x50006 ...00 53 45 00 00 00 ...... WAN (PPP/SLIP) Interface
===========================================================================
===========================================================================
Активные маршруты:
Сетевой адрес           Маска сети      Адрес шлюза       Интерфейс  Метрика
          0.0.0.0          0.0.0.0        10.3.15.2     10.3.15.101       20
         10.0.0.0        255.0.0.0    10.248.156.57   10.248.156.57       1
        10.3.15.0    255.255.255.0      10.3.15.101     10.3.15.101       20
      10.3.15.101  255.255.255.255        127.0.0.1       127.0.0.1       20
    10.248.156.57  255.255.255.255        127.0.0.1       127.0.0.1       50
   10.255.255.255  255.255.255.255      10.3.15.101     10.3.15.101       20
   10.255.255.255  255.255.255.255    10.248.156.57   10.248.156.57       50
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
        224.0.0.0        240.0.0.0      10.3.15.101     10.3.15.101       20
        224.0.0.0        240.0.0.0    10.248.156.57   10.248.156.57       50
  255.255.255.255  255.255.255.255      10.3.15.101               2       1
  255.255.255.255  255.255.255.255      10.3.15.101     10.3.15.101       1
  255.255.255.255  255.255.255.255      10.3.15.101           20005       1
  255.255.255.255  255.255.255.255    10.248.156.57   10.248.156.57       1
Основной шлюз:           10.3.15.2
===========================================================================
Постоянные маршруты:
  Отсутствует

C:\&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (selevo)]]></author>
			<pubDate>Wed, 30 Jul 2014 09:39:47 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85428#p85428</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Как узнать  ip модема?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85426#p85426</link>
			<description><![CDATA[<p>да, ip модема внутренний<br /> он каждый раз разный&nbsp; &nbsp;даётся модему<br /> похоже&nbsp; &nbsp;в диаппазоне 10.24х.ххх.ххх</p>]]></description>
			<author><![CDATA[null@example.com (selevo)]]></author>
			<pubDate>Wed, 30 Jul 2014 08:58:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85426#p85426</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Как узнать  ip модема?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=85415#p85415</link>
			<description><![CDATA[<p><span style="color: green"><strong>selevo</strong>, добавьте в названии темы префикс скриптового языка и оформите код специальным тегом.</span></p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Wed, 30 Jul 2014 05:42:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=85415#p85415</guid>
		</item>
	</channel>
</rss>
