<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Could not close the previous instance of this script.]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=9850&amp;type=atom" />
	<updated>2014-08-06T21:02:04Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=9850</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Could not close the previous instance of this script.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85712#p85712" />
			<content type="html"><![CDATA[<p>Тогда, наверное лучше прописывать значения переменных, полученные во время работы скрипта в ini файл и при повторном запуске считывать их с ini и делать с ними операции, которые должны были выполняться OnExit.<br />Правильно мыслю?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2014-08-06T21:02:04Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85712#p85712</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Could not close the previous instance of this script.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85404#p85404" />
			<content type="html"><![CDATA[<p>Ну да, недавно сам только заметил <a href="http://forum.script-coding.com/viewtopic.php?id=9784">http://forum.script-coding.com/viewtopic.php?id=9784</a>. <br />В данном случае можно копировать малыми частями, из новой копии скрипта посылать WinClose, и ждать закрытия.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-07-29T23:27:11Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85404#p85404</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Could not close the previous instance of this script.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85403#p85403" />
			<content type="html"><![CDATA[<p>Например, вот так:<br /></p><div class="codebox"><pre><code>#SingleInstance Off  
DetectHiddenWindows, On
OnExit, Exit
CurPID := DllCall(&quot;GetCurrentProcessId&quot;)
WinGet, List, List, %A_ScriptFullPath% ahk_class AutoHotkey
Loop % List
{ 
    WinGet, PID, PID, % &quot;ahk_id&quot; List%A_Index%
    If (PID != CurPID)
        Process, Close, %PID% 
}
 ; Далее нужный код
Run, %windir%\system32\notepad.exe
Runwait, C:\Windows\System32\fsutil.exe file createnew C:\test.txt 10000000000
FileCopy C:\test.txt, C:\test1.txt, 1
Exit:
WinClose, Untitled - Notepad
ExitApp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2014-07-29T23:19:30Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85403#p85403</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Could not close the previous instance of this script.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85402#p85402" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Единственное оно не подойдет если есть комманда OnExit.</p></blockquote></div><p>Почему?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-07-29T23:00:35Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85402#p85402</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Could not close the previous instance of this script.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85401#p85401" />
			<content type="html"><![CDATA[<p>Спаcибо за решение.<br />Единственное оно не подойдет если есть комманда OnExit.<br />Но так как у меня его нету, то все ОК.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2014-07-29T22:58:36Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85401#p85401</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Could not close the previous instance of this script.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85400#p85400" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>То есть единственный вариант создать новый скрипт, который будет следить и нажимать кнопку yes в этой табличке?</p></blockquote></div><p>Думаю что нет:<br /></p><div class="codebox"><pre><code>
#SingleInstance Off  
DetectHiddenWindows, On
CurPID := DllCall(&quot;GetCurrentProcessId&quot;)
WinGet, List, List, %A_ScriptFullPath% ahk_class AutoHotkey
Loop % List
{ 
    WinGet, PID, PID, % &quot;ahk_id&quot; List%A_Index%
    If (PID != CurPID)
        Process, Close, %PID% 
}
 ; Далее нужный код
Runwait, C:\Windows\System32\fsutil.exe file createnew C:\test.txt 10000000000
FileCopy C:\test.txt, C:\test1.txt, 1
ExitApp
</code></pre></div><p>Подходит и для компилированных скриптов.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-07-29T22:50:50Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85400#p85400</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Could not close the previous instance of this script.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85399#p85399" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>А с диспетчера он прибивается без проблем?</p></blockquote></div><p>Да.<br /></p><div class="quotebox"><blockquote><p>Из самого скрипта — вряд ли. Думаю, показ этого окна зашит в интерпретаторе.</p></blockquote></div><p>То есть единственный вариант создать новый скрипт, который будет следить и нажимать кнопку yes в этой табличке?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2014-07-29T22:47:37Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85399#p85399</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Could not close the previous instance of this script.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85398#p85398" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>А почему нельзя его закрыть?</p></blockquote></div><p>А с диспетчера он прибивается без проблем?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-07-29T22:01:05Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85398#p85398</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Could not close the previous instance of this script.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85397#p85397" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>А почему нельзя его закрыть?</p></blockquote></div><p>Наверное, чтобы файл не оказался записанным &quot;криво&quot;.<br /></p><div class="quotebox"><blockquote><p>возможно хоть как-то эту табличку убрать?</p></blockquote></div><p>Из самого скрипта — вряд ли. Думаю, показ этого окна зашит в интерпретаторе.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2014-07-29T21:56:09Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85397#p85397</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Could not close the previous instance of this script.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85396#p85396" />
			<content type="html"><![CDATA[<p>Это я понял. А почему нельзя его закрыть? И если невозможно скрипт перезапустить во время копирования, то возможно хоть как-то эту табличку убрать?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2014-07-29T21:04:09Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85396#p85396</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Could not close the previous instance of this script.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85395#p85395" />
			<content type="html"><![CDATA[<p>Наверное, проблема в том, что ты пытаешься закрыть скрипт во время копирования. Но точно сказать со стороны нельзя.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2014-07-29T21:01:56Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85395#p85395</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Could not close the previous instance of this script.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85394#p85394" />
			<content type="html"><![CDATA[<p>В идеале, чтобы скрипт нормально перезапускался.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2014-07-29T20:53:01Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85394#p85394</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Could not close the previous instance of this script.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85393#p85393" />
			<content type="html"><![CDATA[<p>Не совсем понятен вопрос. Тебе нужно, чтобы сообщение об ошибке не появлялось, или чтобы скрипт нормально перезапускался?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2014-07-29T20:46:13Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85393#p85393</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Could not close the previous instance of this script.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=85392#p85392" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#singleinstance force
Runwait, C:\Windows\System32\fsutil.exe file createnew C:\test.txt 10000000000
filecopy C:\test.txt, C:\test1.txt</code></pre></div><p>При запуске этого скрипта и через пару секунд&nbsp; повторном его запуске вылазит дурацкая табличка:<br /></p><div class="quotebox"><blockquote><p>Could not close the previous instance of this script. Keep Waiting?</p></blockquote></div><p>Какие возможны варианты ее убирания?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2014-07-29T20:15:46Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=85392#p85392</id>
		</entry>
</feed>
