<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Событие удаления пароля Windows при завершении работы Windows]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10301&amp;type=atom" />
	<updated>2015-01-05T10:18:51Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=10301</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Событие удаления пароля Windows при завершении работы Windows]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=89987#p89987" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[avens]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24487</uri>
			</author>
			<updated>2015-01-05T10:18:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=89987#p89987</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Событие удаления пароля Windows при завершении работы Windows]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=89971#p89971" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[avens]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24487</uri>
			</author>
			<updated>2015-01-04T10:55:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=89971#p89971</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Событие удаления пароля Windows при завершении работы Windows]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=89970#p89970" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-01-04T10:32:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=89970#p89970</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Событие удаления пароля Windows при завершении работы Windows]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=89966#p89966" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[avens]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24487</uri>
			</author>
			<updated>2015-01-04T08:19:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=89966#p89966</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Событие удаления пароля Windows при завершении работы Windows]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=89963#p89963" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-01-03T16:49:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=89963#p89963</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Событие удаления пароля Windows при завершении работы Windows]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=89960#p89960" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[avens]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24487</uri>
			</author>
			<updated>2015-01-03T13:13:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=89960#p89960</id>
		</entry>
</feed>
