Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.


xcopy batch file

  • Please log in to reply
No replies to this topic

#1 lunaz


  • Members
  • 26 posts
  • Local time:10:42 AM

Posted 14 February 2009 - 09:06 PM

i'm using xcopy to copy stuff from a folder on my computer to a network drive on my server.

xcopy "E:\bak_test" "\\teh-serverer\luna\bak_test"
xcopy "\\teh-serverer\luna\bak_test" "E:\bak_test"

the only thing it doesn't do is delete directories & files on the network drive that have been deleted on the local drive.

what's the best way to go about that?

should i compare the 2 directories first then delete stuff? if so, how?

i looked into the if exist/not exist statements but i dont know how to make it say 'if any dir or file exist on teh-serverer that's not on E:\, then delete it.

BC AdBot (Login to Remove)


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users