manish449
manish449

Reputation: 541

Delete folder contents and copy new files in batch

Hi I am trying to write a batch file that deletes the contents of a folder and replaces it with different files from another location i have the command that deletes the contents its just adding the copy bit so they work in sequence

del "C:\New Folder\*.*

Any help appreciated

So this is the copy command i have found any ideas why it doesnt work?

xcopy c:\New Folder(2)\*.* c:\New Folder /C /S /D /Y /I

Upvotes: 0

Views: 10986

Answers (1)

zentrunix
zentrunix

Reputation: 2270

You should use quotes, because there are embedded spaces in the directory name:

xcopy "c:\New Folder(2)\*.*" "c:\New Folder" /C /S /D /Y /I

(I didn't check the options: /C /S etc).

Upvotes: 2

Related Questions