• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

help with simple batch file

djmonson

New Member
Joined
Jun 17, 2007
Messages
15 (0.00/day)
i want to create a batch file that will:
move files from 'directory1' to 'directory2'
if (and only if) the file DOES NOT begin with an underscore

anyone know how to do this??

David
 

FOXCONN1115

New Member
Joined
Mar 30, 2007
Messages
398 (0.06/day)
Location
Rhode Island, USA
Processor AMD64 Athlon X2 5600+ Socket AM2- 3.43GHz @ 1.45V
Motherboard ASUS Crosshair
Cooling Zalman 9700 and AS5
Memory 2GB Crucial Ballistix DDR2-800- ???? @ 4-4-4-12 2.2V
Video Card(s) EVGA e-Geforce 8800GTX 768MB 630 Core \ 980 Memory
Storage 2x Seagate 320GB 7200.10 in RAID-0 NVRAID, Seagate SATA 1.5GB/s 160GB
Display(s) Samsung Syncmaster 226BW 22" Widescreen, DVI
Case Cooler Master RC-690 (Some Mods.)
Audio Device(s) Creative Audigy 2 ZS
Power Supply 700Watt Thermaltake ToughPower Modular
Software Windows XP Professional SP2- Tweaked :D
umm..? what are you trying to do? copy directories? basic is a good language for things like this. IF/THEN statements rule. :D
 

Random Murderer

The Anti-Midas
Joined
Dec 6, 2006
Messages
6,974 (1.10/day)
Location
Florida, A.K.A. the Sweatbox
System Name TOO MUCH RADIATOR! | The TV Box a.k.a. The Shoebox
Processor Core i7 4930K @ 4.5GHz | Core i5 6600K @ 4.5GHz
Motherboard Asus X79 Rampage IV Extreme | Asus Z170i Pro Gaming
Cooling Custom water on CPU and GPU, dual 360mm radiators | Corsair H80i
Memory 4x 8GB G.Skill TridentX DDR3-1600 | 2x 4GB G.Skill RipJaws 4 DDR4-3000
Video Card(s) Sapphire AMD R9 295x2 | PowerColor AMD HD7970
Storage Samsung SSD 830 256GB, various others | 2x 1TB Seagate Barracudas in RAID1
Display(s) Dell U2713HM 2560x1440 IPS | Panasonic TC-L32E5 1080p IPS TV
Case Thermaltake Suppressor F51 (stripped down to hold two radiators) | Cooler Master Elite 130
Audio Device(s) RM-DAC -> Xiang Sheng 708b -> Sennheiser HD650 | HDMI sound device on 7970
Power Supply LEPA G1600-MA 1600W | Corsair CX750M 750W
Software Win 10 64
Benchmark Scores over 9000 BungholioMarks, "Bitchin' Fast"
umm..? what are you trying to do? copy directories? basic is a good language for things like this. IF/THEN statements rule. :D

yes, but batch files are easier to create within dos, and i think that's what he's trying to do.
 

djmonson

New Member
Joined
Jun 17, 2007
Messages
15 (0.00/day)
sorry if i wasn't specific enough. and i don't need it to be a batch file necessarily.

i want an automated way to move files from one folder to another (both on the C drive)
but i want it to move all mp3 files EXCEPT for the ones that begin with an underscore
 

FOXCONN1115

New Member
Joined
Mar 30, 2007
Messages
398 (0.06/day)
Location
Rhode Island, USA
Processor AMD64 Athlon X2 5600+ Socket AM2- 3.43GHz @ 1.45V
Motherboard ASUS Crosshair
Cooling Zalman 9700 and AS5
Memory 2GB Crucial Ballistix DDR2-800- ???? @ 4-4-4-12 2.2V
Video Card(s) EVGA e-Geforce 8800GTX 768MB 630 Core \ 980 Memory
Storage 2x Seagate 320GB 7200.10 in RAID-0 NVRAID, Seagate SATA 1.5GB/s 160GB
Display(s) Samsung Syncmaster 226BW 22" Widescreen, DVI
Case Cooler Master RC-690 (Some Mods.)
Audio Device(s) Creative Audigy 2 ZS
Power Supply 700Watt Thermaltake ToughPower Modular
Software Windows XP Professional SP2- Tweaked :D
i've found that the easiest way to copy things is to do an advanced search and type in *.mp3 and then just choose whatever files you want, easiest by sorting by name, then copy..
 

djmonson

New Member
Joined
Jun 17, 2007
Messages
15 (0.00/day)
can't that be made into an automated process? i do the action you recommended many times over, and i was hoping that somehow i could create a file that, when double-clicked, would just move the files from that location to another (but not if they start with an underscore, like i mentioned)
 
Joined
May 20, 2004
Messages
10,487 (1.44/day)
So basically you want to move finished downloads to some other folder and temp files start with an underscore? Just a guess.
 

Ehstii

New Member
Joined
Jun 19, 2007
Messages
607 (0.10/day)
Location
The Shore, New Jersey
System Name Betty
Processor AMD Athlon 64 X2 6000+ Windsor 3.0GHz @ 3.16(weak i know, waiting on better HSF)
Motherboard GIGABYTE GA-MA69G-S3H AM2 690G HDMI
Cooling Standard heatsink
Memory A-DATA 2GB(2x1GB dual channel) DDR2 800
Video Card(s) EVGA GeForce 7900GS 256MB
Storage 2x250GB Seagate SataII, 2x250GB Maxtor SataII, 1x120GB Maxtor SataII
Display(s) 22" Widescreen Acer LCD Flat Panel Monitor
Case AMS CF-6129BKS Black w/Silver bezel Steel ATX Mid Tower Computer Case
Audio Device(s) OB
Power Supply Rosewill RP550-2-S ATX12V v2.01 550W Power Supply
Software Windows XP SP2, Adobe Master Collection CS3, WoW, COD4, Cubase LE, Office 2007, Bit Comet, & more...
Benchmark Scores 3DMark06 - 4710
copy and paste this into notepad, and save as .bat



example:

@echo off
xcopy /c /d /f /k /s /y "c:\my music" e:\music



just replace it with the correct locations.

and when you run the batch file it will ask you if you want to copy the the file, or the directory. just type "D" for directory and your good to go.
 
Last edited:

djmonson

New Member
Joined
Jun 17, 2007
Messages
15 (0.00/day)
does the "/c /d /f /k /s /y" section act like an "if statement"? or what is that code for?
 

Ehstii

New Member
Joined
Jun 19, 2007
Messages
607 (0.10/day)
Location
The Shore, New Jersey
System Name Betty
Processor AMD Athlon 64 X2 6000+ Windsor 3.0GHz @ 3.16(weak i know, waiting on better HSF)
Motherboard GIGABYTE GA-MA69G-S3H AM2 690G HDMI
Cooling Standard heatsink
Memory A-DATA 2GB(2x1GB dual channel) DDR2 800
Video Card(s) EVGA GeForce 7900GS 256MB
Storage 2x250GB Seagate SataII, 2x250GB Maxtor SataII, 1x120GB Maxtor SataII
Display(s) 22" Widescreen Acer LCD Flat Panel Monitor
Case AMS CF-6129BKS Black w/Silver bezel Steel ATX Mid Tower Computer Case
Audio Device(s) OB
Power Supply Rosewill RP550-2-S ATX12V v2.01 550W Power Supply
Software Windows XP SP2, Adobe Master Collection CS3, WoW, COD4, Cubase LE, Office 2007, Bit Comet, & more...
Benchmark Scores 3DMark06 - 4710
xcopy is DOS.
its xcopy commands...

/c = Continues copying even if errors occur.
/d = Copies files changed on or after the specified date. If no date is given, copies only those files whose source time is newer than the destination time.
/f = Displays full source and destination file names while copying.
/k = Copies attributes. Normal Xcopy will reset read-only attributes.
/s = Copies directories and subdirectories except empty ones.
/y = Suppresses prompting to confirm you want to overwrite an existing destination file.


its easy and simple. i use it all the time to back up all the stuff on my hard drive to my external.
 

Ehstii

New Member
Joined
Jun 19, 2007
Messages
607 (0.10/day)
Location
The Shore, New Jersey
System Name Betty
Processor AMD Athlon 64 X2 6000+ Windsor 3.0GHz @ 3.16(weak i know, waiting on better HSF)
Motherboard GIGABYTE GA-MA69G-S3H AM2 690G HDMI
Cooling Standard heatsink
Memory A-DATA 2GB(2x1GB dual channel) DDR2 800
Video Card(s) EVGA GeForce 7900GS 256MB
Storage 2x250GB Seagate SataII, 2x250GB Maxtor SataII, 1x120GB Maxtor SataII
Display(s) 22" Widescreen Acer LCD Flat Panel Monitor
Case AMS CF-6129BKS Black w/Silver bezel Steel ATX Mid Tower Computer Case
Audio Device(s) OB
Power Supply Rosewill RP550-2-S ATX12V v2.01 550W Power Supply
Software Windows XP SP2, Adobe Master Collection CS3, WoW, COD4, Cubase LE, Office 2007, Bit Comet, & more...
Benchmark Scores 3DMark06 - 4710
did this help you out?bump.
 

Ehstii

New Member
Joined
Jun 19, 2007
Messages
607 (0.10/day)
Location
The Shore, New Jersey
System Name Betty
Processor AMD Athlon 64 X2 6000+ Windsor 3.0GHz @ 3.16(weak i know, waiting on better HSF)
Motherboard GIGABYTE GA-MA69G-S3H AM2 690G HDMI
Cooling Standard heatsink
Memory A-DATA 2GB(2x1GB dual channel) DDR2 800
Video Card(s) EVGA GeForce 7900GS 256MB
Storage 2x250GB Seagate SataII, 2x250GB Maxtor SataII, 1x120GB Maxtor SataII
Display(s) 22" Widescreen Acer LCD Flat Panel Monitor
Case AMS CF-6129BKS Black w/Silver bezel Steel ATX Mid Tower Computer Case
Audio Device(s) OB
Power Supply Rosewill RP550-2-S ATX12V v2.01 550W Power Supply
Software Windows XP SP2, Adobe Master Collection CS3, WoW, COD4, Cubase LE, Office 2007, Bit Comet, & more...
Benchmark Scores 3DMark06 - 4710
no problem, enjoy.
 
Top