<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Копирование разных субдиректорий в другую директорию]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13152&amp;type=atom" />
	<updated>2017-10-31T22:02:16Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13152</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование разных субдиректорий в другую директорию]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120672#p120672" />
			<content type="html"><![CDATA[<p>Копирование со слиянием папок и заменой файлов, аля explorer:<br /></p><div class="codebox"><pre><code>ComObjCreate(&quot;Shell.Application&quot;).NameSpace(&quot;D:\&quot;).CopyHere(&quot;C:\test&quot;, Yes2All:=0x10)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2017-10-31T22:02:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120672#p120672</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Копирование разных субдиректорий в другую директорию]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120667#p120667" />
			<content type="html"><![CDATA[<p>В общем, если кому надо ...</p><p>Этот код копирует содержимое всех субдиректорий (файлы и папки) из D:\Test\test-1, D:\Test\test-2, D:\Test\test-3 и т.д. (могут быть с любым именем)<br />в одну любую директорию, здесь F:\test</p><div class="codebox"><pre><code>
SourceDir := &quot;D:\test&quot;
DestDir := &quot;F:\test&quot;

Loop % SourceDir &quot;\*&quot;, 2
Loop Parse, A_LoopFileFullPath, `n
	{
	;MsgBox % A_LoopField
	FileCopyDir % A_LoopField, % DestDir, 1
	}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Mambr]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34398</uri>
			</author>
			<updated>2017-10-31T20:04:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120667#p120667</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Копирование разных субдиректорий в другую директорию]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120666#p120666" />
			<content type="html"><![CDATA[<p>Добрый вечер всем!</p><p>Суть вопроса:<br />Есть директория D:\Test, а в ней субдиректории - test 1, test 2 и test 3</p><p>Задача:<br />Скопировать все субдиректории из директории D:\Test в диск F:\</p><p>Этот код работает:<br /></p><div class="codebox"><pre><code>
TestDir := &quot;D:\test&quot;

Loop % TestDir &quot;\*&quot;, 2
Listing := % Listing A_LoopFileName &quot;`n&quot;
Loop Parse, Listing, `n
	{
	;MsgBox % TestDir &quot;\&quot; A_LoopField
	FileCopyDir % TestDir &quot;\&quot; A_LoopField, F:\, 1
	}
</code></pre></div><p>А почему этот не работает:</p><div class="codebox"><pre><code>
TestDir := &quot;D:\test&quot;

Loop % TestDir &quot;\*&quot;, 2
Listing := % Listing A_LoopFileLongPath &quot;`n&quot;
Loop Parse, Listing, `n
	{
	MsgBox % A_LoopField
	FileCopyDir % A_LoopField, F:\, 1
	}
</code></pre></div><p>Хотя MsgBox выдает нормальный path субдиректорий.</p><p>Что я делаю не так в последнем варианте???</p><p>Вариант FileCopyDir % TestDir &quot;\&quot;, F:\, 1 не рассматривать.</p><br /><p>Разобрался!</p><p>Надо вместо<br />A_LoopFileLongPath</p><p>использовать<br />A_LoopFileFullPath</p><p>Так все работает.</p>]]></content>
			<author>
				<name><![CDATA[Mambr]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34398</uri>
			</author>
			<updated>2017-10-31T18:38:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120666#p120666</id>
		</entry>
</feed>
