<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; CMD/BAT: Копирование и переименовывание cmd]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=14220</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14220&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «CMD/BAT: Копирование и переименовывание cmd».]]></description>
		<lastBuildDate>Sun, 07 Oct 2018 08:52:58 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: CMD/BAT: Копирование и переименовывание cmd]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=129081#p129081</link>
			<description><![CDATA[<div class="codebox"><pre><code>@echo off
setlocal enableextensions enabledelayedexpansion

set sSourceFile=c:\1\1.txt
set sDestFolder=c:\2

if exist &quot;%sSourceFile%&quot; (
	if exist &quot;%sDestFolder%\.&quot; (
		for /f &quot;usebackq delims=&quot; %%i in (
			`2^&gt;nul wmic.exe OS get LocalDateTime /value ^| find.exe /i &quot;LocalDateTime&quot;`
		) do for /f &quot;delims=+-&quot; %%j in (&quot;%%i&quot;) do set s%%j
		set sLocalDateTime=!sLocalDateTime:.=!
		set sNewFileName=!sLocalDateTime:~0,-3!.txt
		&gt;nul copy /y &quot;%sSourceFile%&quot; &quot;%sDestFolder%\!sNewFileName!&quot;
	) else (
		echo Can&#039;t find destination folder [%sDestFolder%].
		exit /b 2
	)
) else (
	echo Can&#039;t find source file [%sSourceFile%].
	exit /b 1
)

endlocal
exit /b 0
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (alexii)]]></author>
			<pubDate>Sun, 07 Oct 2018 08:52:58 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=129081#p129081</guid>
		</item>
		<item>
			<title><![CDATA[CMD/BAT: Копирование и переименовывание cmd]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=129079#p129079</link>
			<description><![CDATA[<p>Доброе утро. Прошу помощи при создании кода. <br />Необходимо файл 1.txt из папки с:\1\ скопировать в папку c:\2\ но с другим именем. Можно дату и время в место имени. Ее раззапускаю батник, он снова копирует, но с другим уже именем. <br />Заранее благодарю</p>]]></description>
			<author><![CDATA[null@example.com (blak-x.87)]]></author>
			<pubDate>Sun, 07 Oct 2018 06:07:59 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=129079#p129079</guid>
		</item>
	</channel>
</rss>
