Click here for important information about

batch file help needed copy n rename

Hewlett-packard Pavilion dv6-1350us note...
January 7, 2010 at 22:43:10
Specs: Windows Vista
hey well im working with Halo3 screenshot files that need make the proces faster and easyer i need a batch file to copy files from my main backup folder and rename them in alfabetical/numerical order.
File path>C:\Backup\Xbox Backups\Halo 3 and ODST ScreenShot's
3 orignal file name eg's

desierd file names
>ScreenShot0000 "0000" is a variable and keeps the files in order.

output folder

please any help is a great.i would make this batch file myself but knoledge is limited to the Xcopy,echo and pause comands.

See More: batch file help needed copy n rename

January 8, 2010 at 06:19:36
ok ive got the copy part all good and most of the renameing but i dont know how to make the variable part so far the rename code is:
(ren C:\Users\brody\Desktop\Shots\* ScreenShot*)

imput file:screenshot000000004AA62A103
output file:ScreenShot000000004AA62A103

all i want is a six diget number at the end not all leters and stuff.

imput file:screenshot000000004AA62A103
output file:ScreenShot(000000 to 999999)

Report •

January 8, 2010 at 06:29:21
Do you know you can batch rename in Explorer? You can open
the folder in explorer, select all the files, rename the first to
"Screenshot (1).jpg" and the rest will number themselves. Is that
similar to what you want?

Report •

January 8, 2010 at 07:08:11
similar but not quite what i want also i have only told you a part of my code it goes threw multiple folders each folder has screenshots from a certain map but i dont need help with that i just need a six diget numeric variable eg-number that goes from 000000 to 999999.

Reason for all this:
well i hav a folder with more folders in it witch are folders for spacific maps(location).in these folders are the screenshots from that map(location). ive got code to rename the screenshot part to the map name but they still have the leters and numbers at the end and they are needed to keep order but very hard to understand espesholy when there are over afew hundred screenshots for each map and there are like 30 maps all up.

Report •

Related Solutions

January 8, 2010 at 08:42:58

I understand you want to copy files matching the pattern "screenshot*"
in folder "C:\Backup\Xbox Backups\Halo 3 and ODST ScreenShot's"
to folder "C:\Users\brody\Desktop\Shots"
with file names ScreenShot1, ScreenShot2, etc. (sequentially numbered).
Here is an alternate script.

(Note that, in the script, I am using forward slashes in the path,
instead of backslashes. This alleviates having to worry about
"\t" being treated as tab, etc.
Forward slashes work in window.)

# Script screenshot.txt
var str list, file
var int index
lf -n "screenshot*" "C:/Backup/Xbox Backups/Halo 3 and ODST ScreenShot's" > $list
while ($list <> "")
    lex "1" $list > $file
    system copy ("\""+$file+"\"") ("\"C:/Users/brody/Desktop/Shots/ScreenShot"+makestr(int($index))+"\"")
    set $index = $index + 1

Script is in biterscripting. To execute,
save the script in file "C:/Scripts/screenshot.txt",
start biterscripting, enter the following command.

script "C:/Scripts/screenshot.txt"

Feel free to modify the script for other such automated tasks you may need to perform.
The documentation for the lf command is at .
You will find even more goodies in that command's help page,
so you can narrow down exactly which files are 'picked' by the script to process.

Report •

January 8, 2010 at 14:30:49
Thanksthe code works perfictly but sorry to say i finished makeing a script last night after finding microsofts page on batch files this is my code:


set Game=Halo3
set MapName=Valhala
Set Count=0
Echo Grab ScreenShots From Their Folders
xcopy C:\Backup\XboxBackups\ScreenShot's\%Game%\%MapName% C:\Users\brody\Desktop\Shots /h/e/y/s/i/r
For %%A in (C:\Users\brody\Desktop\Shots\*) Do Call :REN %%A
Set Count=

Set /A Count=%Count%+1
Ren "%*" %Game%%MapName%%Count%
Echo Ren "%*" %Count%

Report •

Ask Question