<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; Копирование файлов из одной папки в другую по дате]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=5297&amp;type=atom" />
	<updated>2011-01-14T11:03:38Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=5297</id>
		<entry>
			<title type="html"><![CDATA[Re: Копирование файлов из одной папки в другую по дате]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=43733#p43733" />
			<content type="html"><![CDATA[<p>А почему не?<br /></p><div class="codebox"><pre><code>echo n|copy…</code></pre></div>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-01-14T11:03:38Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=43733#p43733</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Копирование файлов из одной папки в другую по дате]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=43713#p43713" />
			<content type="html"><![CDATA[<p>Я сделал проще. <br /></p><div class="codebox"><pre><code>copy /-y %sourcedir%\%%n %destdir%\%%j.%%k\ &lt;n.txt</code></pre></div><p>В файле n.txt записана буква n. При запросе на перезапись получается отказ:)</p>]]></content>
			<author>
				<name><![CDATA[neperap]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26543</uri>
			</author>
			<updated>2011-01-14T04:25:18Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=43713#p43713</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Копирование файлов из одной папки в другую по дате]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=43711#p43711" />
			<content type="html"><![CDATA[<p>Судя по <a href="http://forum.script-coding.com/viewtopic.php?pid=43582#p43582">коду</a>, попробуйте что-нибудь наподобие:<br /></p><div class="codebox"><pre><code>if not exist &quot;%destdir%\%%j.%%k\%%n&quot; copy &quot;%sourcedir%\%%n&quot; &quot;%destdir%\%%j.%%k\&quot;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-01-14T04:05:37Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=43711#p43711</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Копирование файлов из одной папки в другую по дате]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=43668#p43668" />
			<content type="html"><![CDATA[<p>Я думаю, что скрипт просто не находил ни одного файла с расширением txt и потому вываливался. А что с вопросом об исключении? Вы сможете помочь?</p>]]></content>
			<author>
				<name><![CDATA[neperap]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26543</uri>
			</author>
			<updated>2011-01-13T09:52:06Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=43668#p43668</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Копирование файлов из одной папки в другую по дате]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=43667#p43667" />
			<content type="html"><![CDATA[<p>Так вот я и не пойму, на что тогда было сие сообщение (от какой команды появлялось)?<br /></p><div class="quotebox"><blockquote><p>и следом сообщение File not found</p></blockquote></div><p>P.S. Это к посту <a href="http://forum.script-coding.com/viewtopic.php?pid=43664#p43664">#33</a></p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-01-13T09:36:57Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=43667#p43667</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Копирование файлов из одной папки в другую по дате]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=43666#p43666" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>если нужно чтобы файлы не перезаписывались, нужно условие if exist добавить</p></blockquote></div><p>Не могу разобраться, куда это условие поставить...</p>]]></content>
			<author>
				<name><![CDATA[neperap]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26543</uri>
			</author>
			<updated>2011-01-13T09:10:01Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=43666#p43666</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Копирование файлов из одной папки в другую по дате]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=43664#p43664" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>neperap пишет:</cite><blockquote><p>Выполняется весь код до copy, и следом сообщение File not found</p></blockquote></div><p>copy и не выполнялась</p>]]></content>
			<author>
				<name><![CDATA[neperap]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26543</uri>
			</author>
			<updated>2011-01-13T08:59:05Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=43664#p43664</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Копирование файлов из одной папки в другую по дате]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=43659#p43659" />
			<content type="html"><![CDATA[<p>Понятно. Впрочем, всё равно не понятно. Ведь тогда, по идее, до<br /></p><div class="codebox"><pre><code>copy /y %sourcedir%\%%n %destdir%\%%j.%%k\</code></pre></div><p>очередь и не дошла бы?</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-01-13T08:17:10Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=43659#p43659</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Копирование файлов из одной папки в другую по дате]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=43656#p43656" />
			<content type="html"><![CDATA[<p>Разобрался в причине ошибки. В исходной папке файлы имеют расширение *.log, а не *.txt. Замена txt на log, и все дела</p>]]></content>
			<author>
				<name><![CDATA[neperap]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26543</uri>
			</author>
			<updated>2011-01-13T05:28:01Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=43656#p43656</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Копирование файлов из одной папки в другую по дате]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=43591#p43591" />
			<content type="html"><![CDATA[<p>Запускается из папки L:\Backups\Ats37&gt;ats37.bat,&nbsp; в которую и должны складываться бэкапы</p>]]></content>
			<author>
				<name><![CDATA[neperap]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26543</uri>
			</author>
			<updated>2011-01-12T11:13:25Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=43591#p43591</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Копирование файлов из одной папки в другую по дате]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=43588#p43588" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>neperap пишет:</cite><blockquote><p>Запускается непосредственно на сервере.</p></blockquote></div><p>Из какой папки запускается? Буквально хочу увидеть ответ, наподобие:<br /></p><div class="quotebox"><blockquote><p><strong>C:\Temp&gt;</strong>0001.cmd</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-01-12T08:55:54Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=43588#p43588</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Копирование файлов из одной папки в другую по дате]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=43582#p43582" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>set sourcedir=\\pcitissvyaz9\d$\Log2
set destdir=L:\Backups\Ats37
for /F &quot;usebackq tokens=1-5,* delims=. &quot; %%i in (`dir %sourcedir%\*.txt /O:D /A:-D^|findstr /R &quot;.*\.txt$&quot;`) do (
if not exist %destdir%\%%j.%%k md %destdir%\%%j.%%k
copy /y %sourcedir%\%%n %destdir%\%%j.%%k\
)</code></pre></div><p>Вот мой вариант кода. Запускается непосредственно на сервере. В исходную папку я попадаю без проблем, простая команда copy тоже выполняется</p>]]></content>
			<author>
				<name><![CDATA[neperap]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26543</uri>
			</author>
			<updated>2011-01-12T03:10:25Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=43582#p43582</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Копирование файлов из одной папки в другую по дате]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=43575#p43575" />
			<content type="html"><![CDATA[<p>По приведённому коду:<br /></p><div class="codebox"><pre><code>set sourcedir=c:\test
set destdir=c:\test22</code></pre></div><p>я не вижу упоминаний об удалённой машине. Приведите <em>Ваш</em> вариант скрипта, который не работает. Укажите как и откуда Вы его запускаете.</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-01-12T01:17:10Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=43575#p43575</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Копирование файлов из одной папки в другую по дате]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=43535#p43535" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>alexii пишет:</cite><blockquote><p>Какой именно «батник»?</p></blockquote></div><p>Батник с кодом, указанным чуть выше <strong>VitAliS</strong><br /></p><div class="codebox"><pre><code>@echo off
set sourcedir=c:\test
set destdir=c:\test22
for /F &quot;usebackq tokens=1-5,* delims=. &quot; %%i in (`dir %sourcedir%\*.txt /O:D /A:-D^|findstr /R &quot;.*\.txt$&quot;`) do (
if not exist %destdir%\%%j.%%k md %destdir%\%%j.%%k
copy /y %sourcedir%\%%n %destdir%\%%j.%%k\
)</code></pre></div><p>С отключённым &quot;@echo off&quot; так и происходит. Выполняется весь код до copy, и следом сообщение File not found. Т.е. как я понял, не получается создать папки на удалённой машине. Локально на моём компе всё работает, папки создаются и файлы копируются. По сети не хочет. Пути указаны правильно, на удалённый комп могу попасть в любую папку. Запускается под учётной записью админа. Связисты уже плешь проели своим нытьём</p>]]></content>
			<author>
				<name><![CDATA[neperap]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26543</uri>
			</author>
			<updated>2011-01-11T10:33:09Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=43535#p43535</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Копирование файлов из одной папки в другую по дате]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=43530#p43530" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>neperap пишет:</cite><blockquote><p>Сегодня первый раз запустил батник на клиентской машине, …</p></blockquote></div><p>Какой именно «батник»?<br /></p><div class="quotebox"><cite>neperap пишет:</cite><blockquote><p>…вываливается File not found.</p></blockquote></div><p>Приведите код скрипта. Приведите сообщение об ошибке, возможно, отключив «@echo off», чтобы увидеть, в какой строке она происходит.</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-01-11T07:52:10Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=43530#p43530</id>
		</entry>
</feed>
