New Posts  All Forums:Forum Nav:

Copy files from list

post #1 of 4
Thread Starter 
Hello,

I think I need a batch file, that's why I am posting here:
I would like to list a lot of files while keeping the folders' structure in which they are, in order to use this list to copy the entire listing somewhere else to make a backup... Don't ask me why I cannot just copy and paste as it is too complicated to explain x)
Thanks for your help!
The Radiator
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-950 @4.2Ghz HT Gigabyte X58-UD3R EVGA GTX580 (900/1800/2400) + PhysX GTX285 Corsair Dominator DDR3 2x2Gb @800Mhz (8-8-8-24-1T) 
Hard DriveOptical DriveOSMonitor
Western Digital Caviar RE3/Green (250Gb/2Tb) LG GH22LS30 LightScribe X22 Windows 7 Ultimate 64bits Alienware OptX™ AW2310 23" 
KeyboardPowerCaseMouse
Logitech G19 Antec TruePower Quattro 1000W Sunbeam Ultra Tech Station UV Blue Logitech G9x 
Mouse Pad
SteelSeries 
  hide details  
Reply
The Radiator
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-950 @4.2Ghz HT Gigabyte X58-UD3R EVGA GTX580 (900/1800/2400) + PhysX GTX285 Corsair Dominator DDR3 2x2Gb @800Mhz (8-8-8-24-1T) 
Hard DriveOptical DriveOSMonitor
Western Digital Caviar RE3/Green (250Gb/2Tb) LG GH22LS30 LightScribe X22 Windows 7 Ultimate 64bits Alienware OptX™ AW2310 23" 
KeyboardPowerCaseMouse
Logitech G19 Antec TruePower Quattro 1000W Sunbeam Ultra Tech Station UV Blue Logitech G9x 
Mouse Pad
SteelSeries 
  hide details  
Reply
post #2 of 4
wait so you want to make a list of all the files and folders in a directory?

if so open up powershell then navigate to the directory that you want the list of then

Code:
ls > filenamethatyouchoose.txt
bam insta list of all the files and folders in that directory

if you only want files in the list that you specify begin with a certain letter or something then do something like

Code:
ls | findstr a* > filenamethatyouchoose.txt
Where "a" is the first letter of all the files that you want in the list
Edited by Macnemarion - 6/5/11 at 6:47am
post #3 of 4
Thread Starter 
Well using cmd the I can do:
Code:
dir /s/b >list.txt
Which I think would gave me the same result as what you adviced me to do. Now how to copy only the files listed in this "list.txt" file to another location remains my problem :S
The Radiator
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-950 @4.2Ghz HT Gigabyte X58-UD3R EVGA GTX580 (900/1800/2400) + PhysX GTX285 Corsair Dominator DDR3 2x2Gb @800Mhz (8-8-8-24-1T) 
Hard DriveOptical DriveOSMonitor
Western Digital Caviar RE3/Green (250Gb/2Tb) LG GH22LS30 LightScribe X22 Windows 7 Ultimate 64bits Alienware OptX™ AW2310 23" 
KeyboardPowerCaseMouse
Logitech G19 Antec TruePower Quattro 1000W Sunbeam Ultra Tech Station UV Blue Logitech G9x 
Mouse Pad
SteelSeries 
  hide details  
Reply
The Radiator
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-950 @4.2Ghz HT Gigabyte X58-UD3R EVGA GTX580 (900/1800/2400) + PhysX GTX285 Corsair Dominator DDR3 2x2Gb @800Mhz (8-8-8-24-1T) 
Hard DriveOptical DriveOSMonitor
Western Digital Caviar RE3/Green (250Gb/2Tb) LG GH22LS30 LightScribe X22 Windows 7 Ultimate 64bits Alienware OptX™ AW2310 23" 
KeyboardPowerCaseMouse
Logitech G19 Antec TruePower Quattro 1000W Sunbeam Ultra Tech Station UV Blue Logitech G9x 
Mouse Pad
SteelSeries 
  hide details  
Reply
post #4 of 4
Code:
for /F %i in (list.txt) do @copy %i THE_DESTINATION
If you need more info on how for works in windows, type for /? in a command prompt, and it will tell you about all of the various options it has.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming