<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Событие удаления пароля Windows при завершении работы Windows]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=10301</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10301&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Событие удаления пароля Windows при завершении работы Windows».]]></description>
		<lastBuildDate>Mon, 05 Jan 2015 10:18:51 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Событие удаления пароля Windows при завершении работы Windows]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89987#p89987</link>
			<description><![CDATA[<div class="quotebox"><cite>Alectric пишет:</cite><blockquote><p>Наверное так:<br /></p><div class="codebox"><pre><code>DllCall(&quot;kernel32.dll\SetProcessShutdownParameters&quot;, UInt, 0x4FF, UInt, 0)
OnMessage(0x11, &quot;WM_QUERYENDSESSION&quot;)
return

WM_QUERYENDSESSION(wParam, lParam)
{
  Runwait, net.exe user %A_UserName% &quot;&quot;
  return true
}
</code></pre></div></blockquote></div><p>Так тоже не работает, выскакивает ошибка инициализации net.exe</p><p>И даже этот скрипт с официальной справки AHK не работает, Windows завершается еще до нажатия в диалоговом окне: Да или Нет...<br /></p><div class="codebox"><pre><code>; The following DllCall is optional: it tells the OS to shut down this script first (prior to all other applications).
; This call has no effect on Windows 9x.
DllCall(&quot;kernel32.dll\SetProcessShutdownParameters&quot;, UInt, 0x4FF, UInt, 0)
OnMessage(0x11, &quot;WM_QUERYENDSESSION&quot;)
return

WM_QUERYENDSESSION(wParam, lParam)
{
    ENDSESSION_LOGOFF = 0x80000000
    if (lParam &amp; ENDSESSION_LOGOFF)  ; User is logging off.
        EventType = Logoff
    else  ; System is either shutting down or restarting.
        EventType = Shutdown
    MsgBox, 4,, %EventType% in progress.  Allow it?
    IfMsgBox Yes
        return true  ; Tell the OS to allow the shutdown/logoff to continue.
    else
        return false  ; Tell the OS to abort the shutdown/logoff.
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (avens)]]></author>
			<pubDate>Mon, 05 Jan 2015 10:18:51 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89987#p89987</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Событие удаления пароля Windows при завершении работы Windows]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89971#p89971</link>
			<description><![CDATA[<div class="quotebox"><cite>Alectric пишет:</cite><blockquote><p>Наверное так:<br /></p><div class="codebox"><pre><code>DllCall(&quot;kernel32.dll\SetProcessShutdownParameters&quot;, UInt, 0x4FF, UInt, 0)
OnMessage(0x11, &quot;WM_QUERYENDSESSION&quot;)
return

WM_QUERYENDSESSION(wParam, lParam)
{
  Runwait, net.exe user %A_UserName% &quot;&quot;
  return true
}
</code></pre></div></blockquote></div><p>Так у меня так и написано, только с добавлением:<br /></p><div class="codebox"><pre><code>....................
    ENDSESSION_LOGOFF = 0x80000000
    if (lParam &amp; ENDSESSION_LOGOFF)  ; User is logging off.
        EventType = Logoff
    else  ; System is either shutting down or restarting.
        EventType = Shutdown

    if EventType = Shutdown
    {
        ifExist, D:\Папка на моем ПК
        {
....................</code></pre></div><p>Но может стоит попробовать и ваш вариант.</p>]]></description>
			<author><![CDATA[null@example.com (avens)]]></author>
			<pubDate>Sun, 04 Jan 2015 10:55:47 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89971#p89971</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Событие удаления пароля Windows при завершении работы Windows]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89970#p89970</link>
			<description><![CDATA[<p>Наверное так:<br /></p><div class="codebox"><pre><code>DllCall(&quot;kernel32.dll\SetProcessShutdownParameters&quot;, UInt, 0x4FF, UInt, 0)
OnMessage(0x11, &quot;WM_QUERYENDSESSION&quot;)
return

WM_QUERYENDSESSION(wParam, lParam)
{
  Runwait, net.exe user %A_UserName% &quot;&quot;
  return true
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alectric)]]></author>
			<pubDate>Sun, 04 Jan 2015 10:32:26 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89970#p89970</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Событие удаления пароля Windows при завершении работы Windows]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89966#p89966</link>
			<description><![CDATA[<p>Благодарю. И не знал что так можно сделать в Windows</p><p>Но так как скрипты в моей программе уже сделаны под предыдущий вариант, неужели средствами AHK нельзя реализовать описанную мной команду?<br />Может на завершения самого скрипта как то можно сделать, если он завершается перед завершением Windows?</p><p>Ведь этот скрипт из стандартной справке AHK должен при завершении Windows отменить завершение работы системы...?<br /></p><div class="codebox"><pre><code>; The following DllCall is optional: it tells the OS to shut down this script first (prior to all other applications).
; This call has no effect on Windows 9x.
DllCall(&quot;kernel32.dll\SetProcessShutdownParameters&quot;, UInt, 0x4FF, UInt, 0)
OnMessage(0x11, &quot;WM_QUERYENDSESSION&quot;)
return

WM_QUERYENDSESSION(wParam, lParam)
{
    ENDSESSION_LOGOFF = 0x80000000
    if (lParam &amp; ENDSESSION_LOGOFF)  ; User is logging off.
        EventType = Logoff
    else  ; System is either shutting down or restarting.
        EventType = Shutdown
    MsgBox, 4,, %EventType% in progress.  Allow it?
    IfMsgBox Yes
        return true  ; Tell the OS to allow the shutdown/logoff to continue.
    else
        return false  ; Tell the OS to abort the shutdown/logoff.
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (avens)]]></author>
			<pubDate>Sun, 04 Jan 2015 08:19:30 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89966#p89966</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Событие удаления пароля Windows при завершении работы Windows]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89963#p89963</link>
			<description><![CDATA[<p>Проще всего сделать автоматический вход по постоянному паролю.<br />Далается это в реестре:<br /></p><div class="codebox"><pre><code>
User=Андрей
Password=тетриандох

RegWrite,REG_SZ,HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon,DefaultUserName,%User%
RegWrite,REG_SZ,HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon,AutoAdminLogon,1
RegWrite,REG_SZ,HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon,DefaultPassword,%Password%
</code></pre></div><p>Присвой переменным &quot;User&quot; и &quot;Password&quot; имя пользователя и пароль соответственно.</p>]]></description>
			<author><![CDATA[null@example.com (Alectric)]]></author>
			<pubDate>Sat, 03 Jan 2015 16:49:42 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89963#p89963</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Событие удаления пароля Windows при завершении работы Windows]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=89960#p89960</link>
			<description><![CDATA[<p>Моя программа на AHK при запуске устанавливает пароль для Windows, что бы я мог заходить с Android устройства по сети WiFi через ES Explorer в расшаренные папки на ПК, потому как без пароля на XP соединится не удается.<br />А при завершении работы Windows мне надо что бы этот &quot;временный пароль&quot; удалялся..</p><p>Этот скрипт по идеи должен запускать net.exe и удалять пароль, но вместо этого выскакивает какая то ошибка запуска &quot;net.exe&quot; и пароль не удаляется, после воспроизводится звук &quot;SoundPlay, *64&quot; и Windows завершает работу.<br /></p><div class="codebox"><pre><code>DllCall(&quot;kernel32.dll\SetProcessShutdownParameters&quot;, UInt, 0x4FF, UInt, 0)
OnMessage(0x11, &quot;WM_QUERYENDSESSION&quot;)
Return

WM_QUERYENDSESSION(wParam, lParam)
{
    ENDSESSION_LOGOFF = 0x80000000
    if (lParam &amp; ENDSESSION_LOGOFF)  ; User is logging off.
        EventType = Logoff
    else  ; System is either shutting down or restarting.
        EventType = Shutdown

    if EventType = Shutdown
    {
        ifExist, D:\Папка на моем ПК
        {
            RunWait, net.exe user %A_UserName% &quot;&quot; ;, , Hide
            SoundPlay, *64
        }
        Return 1 ;Завершить true/1, отмена false/0
    }
}
return</code></pre></div><p>Как можно сделать что бы эта команда срабатывала при завершении работы Windows?<br /></p><div class="codebox"><pre><code>RunWait, net.exe user %A_UserName% &quot;&quot;, , Hide</code></pre></div><p>Вне данного примера скрипта эта команда на моем ПК выполняется отлично!</p>]]></description>
			<author><![CDATA[null@example.com (avens)]]></author>
			<pubDate>Sat, 03 Jan 2015 13:13:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=89960#p89960</guid>
		</item>
	</channel>
</rss>
