<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Подключение к интернету (Wi-Fi)]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14848&amp;type=atom" />
	<updated>2019-07-06T20:32:23Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14848</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подключение к интернету (Wi-Fi)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134787#p134787" />
			<content type="html"><![CDATA[<p>У меня такой скрипт сам определяет название подключения, если оно единственное wi-fi. Должен быть запущен от администратора.<br /></p><div class="codebox"><pre><code>$F10:: ToggleWiFi()

ToggleWiFi()  {
   wmi := ComObjGet(&quot;winmgmts:&quot;)
   for adapter in wmi.ExecQuery(&quot;Select * from Win32_NetworkAdapter&quot;)
      if InStr(adapter.name, &quot;wireless&quot;) &amp;&amp; (interfaceName := adapter.NetConnectionID) &amp;&amp; status := adapter.NetConnectionStatus
         break
      
   if (interfaceName = &quot;&quot; || status = &quot;&quot;)  {
      MsgBox, Failed to get interfaceName!
      return
   }
   if status not in 0,2   ; Disconnected = 0, Connected = 2
   {
      Loop  {
         Sleep, 500
         for adapter in wmi.ExecQuery(&quot;Select * from Win32_NetworkAdapter Where Index=&quot; . adapter.Index)
            status := adapter.NetConnectionStatus
      } until status = 0 || status = 2 || (A_Index = 20 &amp;&amp; failed := true)
      if failed  {
         MsgBox, Failed to get the status!
         return
      }
   }
   Run, % (A_IsAdmin ? &quot;&quot; : &quot;*RunAs &quot;) . &quot;netsh.exe interface set interface name=&quot;&quot;&quot;
                                       . interfaceName . &quot;&quot;&quot; admin=&quot;
                                       . (status = 0 ? &quot;en&quot; : &quot;dis&quot;) . &quot;abled&quot;,, Hide
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-07-06T20:32:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134787#p134787</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Подключение к интернету (Wi-Fi)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134785#p134785" />
			<content type="html"><![CDATA[<p>Пользуйтесь поиском.<br /><a href="http://forum.script-coding.com/viewtopic.php?id=5201">AHK: подключение/отключение интернета</a><br /><a href="http://forum.script-coding.com/viewtopic.php?id=7985">AHK: Настройки сетевого адаптера</a><br /><a href="http://forum.script-coding.com/viewtopic.php?id=8812">AHK: Управлением сетевым адаптером</a><br /><a href="http://forum.script-coding.com/viewtopic.php?id=11774">AHK: Отключение интернета.</a></p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2019-07-06T16:56:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134785#p134785</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Подключение к интернету (Wi-Fi)]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134784#p134784" />
			<content type="html"><![CDATA[<p>Всем привет! <br />Подскажите пожалуйста код, чтобы сделать горячую клавишу, отключить/включить доступ к интернету (Беспроводное сетевое соединение).</p>]]></content>
			<author>
				<name><![CDATA[tregalka]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33600</uri>
			</author>
			<updated>2019-07-06T15:45:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134784#p134784</id>
		</entry>
</feed>
