home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

batch file for renaming.

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2642
Discussions: 200,966, Posts: 2,379,630, Members: 246,332
Old February 21st, 2007, 05:25 PM   Digg it!   #1 (permalink)
Senior Member
 
BattleToad's Avatar
 
Join Date: Aug 2004
Location: Virginia Beach, Va
Posts: 603
Send a message via AIM to BattleToad
batch file for renaming.

I have a bunch of images (roughly 700) I would like to rename and my batch skills are a little bit rusty. The naming scheme I like to use on images is just numerical order, 0001.jpg...0002.jpg...0003.jpg etc. Could anyone point me in the right direction for writing a batch file that does then when executed? Either to the directory its in or just have to edit the file to change directories. From the command line in Linux I could come up with a shell script no problem, but alas these files are on a windows box.
__________________
"There are only 10 kinds of people in the world, those that can read binary, and those that cannot."
BattleToad is offline   Reply With Quote
Old February 21st, 2007, 06:10 PM     #2 (permalink)
Super Stealthy Moderator
 
RicheemxX's Avatar
 
Join Date: Jan 2003
Location: Outside the box
Posts: 5,557
Blog Entries: 4
Send a message via Yahoo to RicheemxX
I don't know about creating the batch file but I use infranview to batch rename/resize all my photo's
__________________
“Every question involves someone having to work for an answer, isn't it about time you did your share”
"Non-technical questions sometimes don't have an answer at all."
Linus Torvalds
RicheemxX is offline   Reply With Quote
Old February 21st, 2007, 07:32 PM     #3 (permalink)
Senior Member
 
BattleToad's Avatar
 
Join Date: Aug 2004
Location: Virginia Beach, Va
Posts: 603
Send a message via AIM to BattleToad
will look into that thanks.
BattleToad is offline   Reply With Quote
Old February 24th, 2007, 09:48 AM     #4 (permalink)
Member
 
Join Date: Oct 2003
Posts: 263
vb.net

this can easily be done in vb.net , c#...i would be tempted to just use vb.net instead of using vbscript.

To get the files in the directory :
Code:
'Declare the array to hold the files 
dim strHolder() as string
dim i as int32
dim strDestinationFolder="C:\Folder\New"


strHolder=System.IO.Directory.GetFiles("C:\Folder")

for i=0 to ubound(strHolder,1)
            Dim j As new System.IO.FileInfo(strHolder(i))
            j.CopyTo(strDestinationFolder)

next
amtrac24 is offline   Reply With Quote
Old February 24th, 2007, 09:55 AM     #5 (permalink)
Member
 
Join Date: Oct 2003
Posts: 263
whoops...sorry should be this


Code:
dim strHolder() as string
dim i as int32,x as int32
dim strDestinationFolder="C:\Folder\New"


strHolder=System.IO.Directory.GetFiles("C:\Folder")

for i=0 to ubound(strHolder,1)
            Dim j As new System.IO.FileInfo(strHolder(i))
            j.CopyTo(strDestinationFolder & "\" & strHolder(i) & x & ".jpg"
            x+=1

next
something along those lines.
amtrac24 is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch file to copy/rename file with current time jp22382 Applications and Operating Systems 2 May 19th, 2009 07:25 AM
Batch renaming help Wakeboarder141 Applications and Operating Systems 2 September 8th, 2006 12:05 AM
Batch File Help PeterGriffin General Tech Discussion 0 October 28th, 2004 03:52 PM
batch file help glue_head Applications and Operating Systems 9 August 29th, 2003 06:44 PM
renaming a file lreid Applications and Operating Systems 3 June 1st, 2003 12:11 AM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (3007)
Forty-six years ago today (7)
Laptop with wireless problem. (12)
Wireless Televisions. (12)
CPU fan stops spinning randomly (11)
Regular Build (11)
Internet Lost (5)
windows 7 problem (7)
windows vista security holes (15)
Point and Shoot Camera Suggestions. (6)
Is the PSU I received dead? (13)
radeon x850xt platinum & shader.. (6)
HIS HD5770 graphic card question (15)
Install XP pro and a Vista laptop ?.. (11)
Recent Discussions
windows vista security holes (15)
Help getting around port 80 for camer.. (4)
Laptop with wireless problem. (12)
Open With ..... Win7 (2)
Internet Lost (5)
Skillsoft Network+ Study Software Que.. (9)
virus blocking exe. files (1)
Point and Shoot Camera Suggestions. (6)
CPU fan stops spinning randomly (11)
Nvidia GTX 260 problem (1)
Modern Warfare 2: Who Bought It? (65)
Is the PSU I received dead? (13)
Print spooler problem (16)
Kingston Bluetooth Dongle Driver (1)
Multiple Restarts Required at Boot (3)
webcam (0)
upgrade for hp a6101 (0)
tv not turn on-makes clicking sound (2)
EVGA 9800 gtx help with finding a goo.. (11)
Regular Build (11)
Help with onclick and buttons (0)
Virus advise (8)
My monitor won't turn on after instal.. (1)
Dept. of HS: NSA 'Helped' Develop Vis.. (16)
Ideal cheap graph card for PC-Gaming? (18)


All times are GMT -4. The time now is 02:10 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28