Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.
move files in batches
Name: TheNutz Date: August 22, 2009 at 05:50:49 Pacific OS: Windows XP Subcategory: Batch
Comment:
Hello,
I'm hoping someone can help me with a problem. I need to have a batchfile witch can move all my fonts from their folders into one folder.
ex: in folder FONTS i have the folder fontname1, fontname2... fontnameX, and i want to move the files from every fontname folders (1,2..x) into one folder.
See IVO´s post. You only has to eliminate size comparison and change %%~zj to %%jj.
0
Response Number 2
Name: TheNutz Date: August 22, 2009 at 08:48:58 Pacific
Reply:
thank you very much.
0
Response Number 3
Name: TheNutz Date: August 22, 2009 at 08:54:28 Pacific
Reply:
it's not working :( @echo off pushd c:\Oldlocation for %%j in (*.txt*) do if %%~jj move "%%j" "c:\newlocation" popd
0
Response Number 4
Name: ricardo647 Date: August 22, 2009 at 19:53:13 Pacific
Reply:
Correct to:
@echo off for %%j in (*.txt) do move "%%j" "c:\newlocation"
0
Response Number 5
Name: TheNutz Date: August 22, 2009 at 22:24:41 Pacific
Reply:
thank you. but it's not working with subfolders :(
0
Response Number 6
Name: Sen Hu Date: August 23, 2009 at 09:44:08 Pacific
Reply:
You want to move all files from C:\....\FONTS\fontname1, C:\....\FONTS\fontname2, C:\....\FONTS\fontnamex to C:\...\FONTS ? Here is a script.
# Script movefonts.txt
# Collect list of files.
var str list ; lf -n "*" "C:\...\FONTS" ($ftype=="f") > $list
while ($list <> "")
do
# Get the next file from the list.
var str file ; lex "1" $list > $file
# Move file to "C:\...\FONTS".
system move ("\""+$file+"\"") ("\""+"C:\...\FONTS"+"\"")
done
Make sure you change "C:\...\FONTS" to the correct path everywhere in the script. Script is in biterscripting ( http://www.biterscripting.com ). Save the script as C:\Scripts\movefonts.txt, start biterscripting, enter the following command.
script movefonts.txt
Test the script first. I have not tested it.
Sen
0
Response Number 7
Name: TheNutz Date: August 23, 2009 at 10:03:27 Pacific
Summary: Hi All I have a file that is created each day and always dumps as "Output", renamed as follows: @echo off for /f "tokens=1-4 delims=/ " %%d in ("%date%") do rename "C:\output.txt" output_%%d_%%e_%%f.t...
Summary: Hi, I want to rename the following files in a batch/DOS/Linux: az1_rdb To az_rdb.txt1 az2_rdb To az_rdb.txt2 Any ideas? [Of course I'm talking about lots and lots of files, that's why I need the batch...
Summary: Hi, I am new to batch script and need help. I have below a2.csv file: HDR20090619a2 aaa,111,222,333,bbb bbb,222,111,444,ccc ccc,333,444,111,ddd TRL000000003 In the batch script need to read the csv fi...