<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: batch script to add remove prefix zero pad bulk file rename</title>
	<atom:link href="http://kedar.nitty-witty.com/blog/batch-script-to-add-remove-prefix-zero-pad-bulk-file-rename/feed" rel="self" type="application/rss+xml" />
	<link>http://kedar.nitty-witty.com/blog/batch-script-to-add-remove-prefix-zero-pad-bulk-file-rename</link>
	<description>Kedar&#039;s Blog for MySQL and more</description>
	<lastBuildDate>Fri, 27 Jan 2012 04:35:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: keith</title>
		<link>http://kedar.nitty-witty.com/blog/batch-script-to-add-remove-prefix-zero-pad-bulk-file-rename/comment-page-1#comment-3074</link>
		<dc:creator>keith</dc:creator>
		<pubDate>Wed, 16 Mar 2011 04:49:28 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=683#comment-3074</guid>
		<description>I am looking to just rename *.jpg files to a fixed length.  They all need to be 7 left of .jpg?  
Can your example pad script be modified to do that easily?
Examples:
1234567.jpg   ok already.
123456.jpg  needs to be 0123456.jpg
And of course they could start with 26.jpg (one or more numbers left of jpg) for example  0000026.jpg

tia.</description>
		<content:encoded><![CDATA[<p>I am looking to just rename *.jpg files to a fixed length.  They all need to be 7 left of .jpg?<br />
Can your example pad script be modified to do that easily?<br />
Examples:<br />
1234567.jpg   ok already.<br />
123456.jpg  needs to be 0123456.jpg<br />
And of course they could start with 26.jpg (one or more numbers left of jpg) for example  0000026.jpg</p>
<p>tia.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kedar</title>
		<link>http://kedar.nitty-witty.com/blog/batch-script-to-add-remove-prefix-zero-pad-bulk-file-rename/comment-page-1#comment-300</link>
		<dc:creator>Kedar</dc:creator>
		<pubDate>Mon, 22 Mar 2010 14:49:45 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=683#comment-300</guid>
		<description>You may read from and write to a file to remember last file name using batch script.
Create a counter.txt to store the last variable value
As per my script use following line to assign last counter value.

set /p cnt=&lt;counter.txt

After you&#039;re done with renaming reset the value in counter.txt as follows:
echo !cnt!&gt;counter.txt

Consider this:-

Step 1: Create counter.txt in same directory of script.
step 2: Use below script updated to read counter value from a text file and rename from that number.

@echo off
setLocal EnableDelayedExpansion

:: set /a cnt=1
set /p cnt=&lt;counter.txt
echo !cnt!
for %%i in (*.%1) do (
call :Set0Pad %2

set newName=!str! %%i
ren &quot;%%i&quot; &quot;!newName!&quot;
echo !cnt!&gt;counter.txt
)

:Set0Pad
set padcntr=0000000000%cnt%
set str=!padcntr:~-%1!
set renstr=%str%
set /a cnt+=1</description>
		<content:encoded><![CDATA[<p>You may read from and write to a file to remember last file name using batch script.<br />
Create a counter.txt to store the last variable value<br />
As per my script use following line to assign last counter value.</p>
<p>set /p cnt=<counter .txt</p>
<p>After you're done with renaming reset the value in counter.txt as follows:<br />
echo !cnt!>counter.txt</p>
<p>Consider this:-</p>
<p>Step 1: Create counter.txt in same directory of script.<br />
step 2: Use below script updated to read counter value from a text file and rename from that number.</p>
<p>@echo off<br />
setLocal EnableDelayedExpansion</p>
<p>:: set /a cnt=1<br />
set /p cnt=</counter><counter .txt<br />
echo !cnt!<br />
for %%i in (*.%1) do (<br />
call :Set0Pad %2</p>
<p>set newName=!str! %%i<br />
ren "%%i" "!newName!"<br />
echo !cnt!>counter.txt<br />
)</p>
<p>:Set0Pad<br />
set padcntr=0000000000%cnt%<br />
set str=!padcntr:~-%1!<br />
set renstr=%str%<br />
set /a cnt+=1</counter></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Renamer</title>
		<link>http://kedar.nitty-witty.com/blog/batch-script-to-add-remove-prefix-zero-pad-bulk-file-rename/comment-page-1#comment-299</link>
		<dc:creator>Renamer</dc:creator>
		<pubDate>Sun, 21 Mar 2010 09:06:51 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=683#comment-299</guid>
		<description>I need to create an batch file that will
rename a file on my F: drive

named MyBackup 00001.qic

to MyBackup nnnnn.qic (nnnnn = next available file number).

For example if files exist:
MyBackup 00002.qic
MyBackup 00003.qic
MyBackup 00004.qic
MyBackup 00005.qic

then rename MyBackup 00001.qic to MyBackup 00006.qic

Yes, the file names always have a space just before the 5 digit number.

Since I am just learning how to write .bat files for my Windows2000 Computers,

&lt;a href=&quot;http://www.ulfwood.net/RenameFiles/FileRenamer.aspx&quot; rel=&quot;nofollow&quot;&gt;File Renamer&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>I need to create an batch file that will<br />
rename a file on my F: drive</p>
<p>named MyBackup 00001.qic</p>
<p>to MyBackup nnnnn.qic (nnnnn = next available file number).</p>
<p>For example if files exist:<br />
MyBackup 00002.qic<br />
MyBackup 00003.qic<br />
MyBackup 00004.qic<br />
MyBackup 00005.qic</p>
<p>then rename MyBackup 00001.qic to MyBackup 00006.qic</p>
<p>Yes, the file names always have a space just before the 5 digit number.</p>
<p>Since I am just learning how to write .bat files for my Windows2000 Computers,</p>
<p><a href="http://www.ulfwood.net/RenameFiles/FileRenamer.aspx" rel="nofollow">File Renamer</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

