<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; CMD/BAT: Проверка наличия папки, соответствующей разрядности системы]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12260&amp;type=atom" />
	<updated>2016-12-26T15:28:48Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12260</id>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Проверка наличия папки, соответствующей разрядности системы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=110271#p110271" />
			<content type="html"><![CDATA[<p>Если только правильно понял:<br /></p><div class="codebox"><pre><code>set &quot;source_dir=\\ws-it-18\etc\LibreOffice\extensions&quot;
if defined ProgramFiles(x86) (
	set &quot;target_dir=%ProgramFiles(x86)%\LibreOffice 5\share\extensions&quot;
) else (
	set &quot;target_dir=%ProgramFiles%\LibreOffice 5\share\extensions&quot;
)
if not exist &quot;%target_dir%\&quot; xcopy /s /e /h /y &quot;%source_dir%&quot; &quot;%target_dir%&quot;
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[shiz]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26249</uri>
			</author>
			<updated>2016-12-26T15:28:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=110271#p110271</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[CMD/BAT: Проверка наличия папки, соответствующей разрядности системы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=110248#p110248" />
			<content type="html"><![CDATA[<p>Доброго времени!</p><p>Возникла потребность в написании скрипта для копирования расширения программного обеспечения. </p><p>К сожалению, я редко пользуюсь скриптами, по этому обращаюсь здесь.</p><p>Подскажите, пожалуйста, как реализовать следующий скрипт:</p><p>При запуске, скрипт должен проверить наличие папки (в зависимости от разрядности ОС пути разные), если папка есть, то прекратить выполнение.<br />Если папки нет, то скопировать из сетевого пути папку в определённый каталог, опять же в зависимости от разрядности системы на которой выполняется скрипт.</p><p>Набросал скрипт для копирования в зависимости от разрядности ОС и тут всё предельно ясно:</p><div class="codebox"><pre><code>@echo off
set old_dir=&quot;\\ws-it-18\etc\LibreOffice\extensions&quot;
set new_dirx32=&quot;C:\Program Files\LibreOffice 5\share\extensions&quot;
set new_dirx64=&quot;C:\Program Files (x86)\LibreOffice 5\share\extensions&quot;
if &quot;%PROCESSOR_ARCHITECTURE%&quot;==&quot;x86&quot; (
  xcopy %old_dir% %new_dirx32% /s /e /h /y
) else (
  xcopy %old_dir% %new_dirx64% /s /e /h /y
)
exit /b</code></pre></div><p>А вот как реализовать проверку наличия папки в зависимости от разрядности и копирование в зависимости от разрядности, к сожалению, пока не смог, по этому прошу вашей помощи.</p><p>Заранее спасибо! <br />С наступающими праздниками <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[Peligan]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34419</uri>
			</author>
			<updated>2016-12-26T12:01:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=110248#p110248</id>
		</entry>
</feed>
