<?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: список файлов с относительным путем]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=9356</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=9356&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «CMD/BAT: список файлов с относительным путем».]]></description>
		<lastBuildDate>Wed, 12 Mar 2014 16:30:56 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: CMD/BAT: список файлов с относительным путем]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80734#p80734</link>
			<description><![CDATA[<p>Спасибо!!!<br />С виртуальным диском мысль была, но ... не додумал <br />сейчас довел до такого:</p><div class="codebox"><pre><code>for /f &quot;tokens=*&quot; %%i in (&#039;dir /a-d /b /s %virt_disk%\&#039;) do (
 TFTP -i 192.168.1.127 PUT %%i %%~pnxi
)
</code></pre></div><p>а вот так <br /></p><div class="codebox"><pre><code>for /f &quot;tokens=*&quot; %%i in (&#039;dir /a-d /b /s %virt_disk%\&#039;) do (
set relat_path=%%~pnxi
 TFTP -i 192.168.1.127 PUT %%i  !relat_path:~1!
) 
</code></pre></div><p>не заработало (хотя с echo работает)</p>]]></description>
			<author><![CDATA[null@example.com (VitekSVM)]]></author>
			<pubDate>Wed, 12 Mar 2014 16:30:56 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80734#p80734</guid>
		</item>
		<item>
			<title><![CDATA[Re: CMD/BAT: список файлов с относительным путем]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80722#p80722</link>
			<description><![CDATA[<div class="codebox"><pre><code>@echo off
setlocal enabledelayedexpansion

set const_path=D:\Trans_data\WEB_data
set virt_disk=B:

subst %virt_disk% &quot;%const_path%&quot;|| exit /b

for /f &quot;tokens=*&quot; %%i in (&#039;dir /a-d /b /s %virt_disk%\&#039;) do (
 set relat_path=%%~pnxi
 echo !relat_path:~1!
)

subst %virt_disk% /d
pause&gt;nul
endlocal
exit /b</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Yury)]]></author>
			<pubDate>Wed, 12 Mar 2014 15:05:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80722#p80722</guid>
		</item>
		<item>
			<title><![CDATA[CMD/BAT: список файлов с относительным путем]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=80703#p80703</link>
			<description><![CDATA[<p>Есть папка с подпапками и файлами, которые рассположены так как надо на TFTP сервере.<br />Но немогу выделить относительный путь этих файлов. в результате должно получиться вот так:<br />TFTP -i 192.168.1.127 PUT D:\Trans_data\WEB_data\css\style.css&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; css/style.css <br />TFTP -i 192.168.1.127 PUT D:\Trans_data\WEB_data\img\flags\ua.png&nbsp; &nbsp; &nbsp; &nbsp; img/flags/ua.png<br />TFTP -i 192.168.1.127 PUT D:\Trans_data\WEB_data\img\flags\ru.png&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;img/flags/ru.png<br />TFTP -i 192.168.1.127 PUT D:\Trans_data\WEB_data\img\flags\gb.png&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;img/flags/gb.png<br />TFTP -i 192.168.1.127 PUT D:\Trans_data\WEB_data\img\flags\by.png&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;img/flags/by.png<br />TFTP -i 192.168.1.127 PUT D:\Trans_data\WEB_data\img\ke_logo_291x80.png&nbsp; &nbsp;img/ke_logo_291x80.png<br />TFTP -i 192.168.1.127 PUT D:\Trans_data\WEB_data\img\ke.ico&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;img/ke.ico<br />TFTP -i 192.168.1.127 PUT D:\Trans_data\WEB_data\index.html&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;index.html <br />TFTP -i 192.168.1.127 PUT D:\Trans_data\WEB_data\bridge-0.2.js&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bridge-0.2.js<br />TFTP -i 192.168.1.127 PUT D:\Trans_data\WEB_data\2.json&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2.json<br />TFTP -i 192.168.1.127 PUT D:\Trans_data\WEB_data\1.json&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1.json</p><p>т.е. bat-файл лежит в D:\Trans_data\ (в данном случае) , запустив его нужно найти все файлы в папке WEB_data и ее подпапках, а также относительные пути (относительно WEB_data) этих же файлов. <br />FOR и DIR с рекурсиями дают только полный путь, а относительный как сделать не врубаюсь!!!</p>]]></description>
			<author><![CDATA[null@example.com (VitekSVM)]]></author>
			<pubDate>Wed, 12 Mar 2014 10:52:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=80703#p80703</guid>
		</item>
	</channel>
</rss>
