Batch File

Soldato
Joined
19 Feb 2009
Posts
3,373
Hey, basically, I need a batch file that will copy a folder to two locations. I want it so when I drag a folder of music on top of it, it'll copy to my main music folder and the public one. I could do it manually but laziness wins, any ideas? :)

Thanks.
 
Code:
@echo off
set mymusic="C:\Documents and Settings\whitecrook\Desktop\New Folder (3)\dest1"
set publicmusic="C:\Documents and Settings\whitecrook\Desktop\New Folder (3)\dest2"
set source="%~1"

xcopy /Y /S /E /R /V /K /F /C /H %source% %mymusic%
xcopy /Y /S /E /R /V /K /F /C /H %source% %publicmusic%

pause

test first, use at own risk etc etc
 
may need the %source% statement adjusting because of extra quotes and so on took me ages to get my copy command working. (useing ROBOCOPY)
 
what extra quotes? the ' ~ ' removes any quotes if they are there, and then the quotes on each side ensure they are there, incase the dropped path has spaces in it.
 
Back
Top Bottom