<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; CMD/BAT: Ожидание завершения работы bat-файл]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8044&amp;type=atom" />
	<updated>2013-02-06T21:10:56Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=8044</id>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Ожидание завершения работы bat-файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69183#p69183" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>@echo off

if defined secondary goto :main
set &quot;secondary=yes&quot;

:loop
2&gt;nul cmd /c &quot;&quot;%~f0&quot; %* 3&gt;&gt;&quot;%~f0.lck&quot;&quot; || (ping -n 1 -w 1000 127.255.255.255 &gt;nul &amp; goto:loop)
exit

:main
echo Single
pause</code></pre></div><p>Сейчас при повторном запуске батника, выходит что файл &quot;%~f0.lck&quot; занят другим процессом, подскажите, как мне можно разблокировать данный файл?</p>]]></content>
			<author>
				<name><![CDATA[lorents]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27502</uri>
			</author>
			<updated>2013-02-06T21:10:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69183#p69183</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Ожидание завершения работы bat-файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69131#p69131" />
			<content type="html"><![CDATA[<p>Понял, спасибо большое</p>]]></content>
			<author>
				<name><![CDATA[lorents]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27502</uri>
			</author>
			<updated>2013-02-05T18:18:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69131#p69131</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Ожидание завершения работы bat-файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69129#p69129" />
			<content type="html"><![CDATA[<p><strong>lorents</strong>, по той ссылке показан механизм запрета параллельного запуска скрипта. Ожидание завершения запущенной копии скрипта - аналогична приведенной задаче.</p>]]></content>
			<author>
				<name><![CDATA[Rumata]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24846</uri>
			</author>
			<updated>2013-02-05T17:33:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69129#p69129</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Ожидание завершения работы bat-файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69128#p69128" />
			<content type="html"><![CDATA[<p>не совсем понял, как это может помочь с моей проблемой?</p>]]></content>
			<author>
				<name><![CDATA[lorents]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27502</uri>
			</author>
			<updated>2013-02-05T17:21:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69128#p69128</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Ожидание завершения работы bat-файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69112#p69112" />
			<content type="html"><![CDATA[<p>Посмотрите: <a href="http://forum.script-coding.com/viewtopic.php?id=1151">CMD/BAT: запуск единственной копии сценария</a>.</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2013-02-04T21:15:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69112#p69112</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[CMD/BAT: Ожидание завершения работы bat-файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69111#p69111" />
			<content type="html"><![CDATA[<p>Добрый вечер!<br />Помогите, пожалуйста решить следующую проблему.</p><p>У меня есть bat-файл который выполняет определенную задачу, и после окончания работы не закрывается, а ждет закрытия от пользователя. Допустим во время работы первого bat-файл я запускаю еще одну копию bat-файла, как мне сделать, чтобы вновь запущенный bat-файл ждал ожидания завершении работы первого bat-файла. Проблема в том, что первое окно bat-файла не закрыто, а мне надо запустить в работы его вторую копию.</p><p>Иными словами сделать функцию как в WinRAR</p><p><span class="postimg"><img src="http://habrastorage.org/storage2/538/540/6f7/5385406f7d9957b05744998db6d5ace9.png" alt="http://habrastorage.org/storage2/538/540/6f7/5385406f7d9957b05744998db6d5ace9.png" /></span></p>]]></content>
			<author>
				<name><![CDATA[lorents]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27502</uri>
			</author>
			<updated>2013-02-04T20:55:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69111#p69111</id>
		</entry>
</feed>
