Link to home
Start Free TrialLog in
Avatar of timerack
timerack

asked on

Batch Script to copy and remove files from one directory to another

Need to do the following:

1) Local Disk: C://users/administrator/backup
2) Network Drive: Z//backup/production

Need to run a Batch script which simply Runs daily and COPIES all the files from Local Disk C TO Network drive Z. It also removes all the files from Local Disk C when the files have been copied successfully and Appends the new files to the Network Drive on a daily basis.

thanks.
ASKER CERTIFIED SOLUTION
Avatar of chakko
chakko
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Is this a Windows environment?

1) Local Disk: C://users/administrator/backup
2) Network Drive: Z//backup/production

I do not recognize the slashes (/) - would be backslash (\) in Windows.

If this is windows:

Make a short batchfile:

Use xcopy with appropriate flags to copy files and directories
Use del with appropriate flags to delete copied files.

I assume that the files have different names from day to day - otherwise you have to deal with that as well not to lose information by overwriting.

The spec of what you want to achieve has to be more specific!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Does Windows server 2003 contain robocopy? SSisworo is anyway correct about his part and XYLOG about scheduling
Avatar of xylog
xylog

Robocopy is a free download here as part of the  Windows Server 2003 Resource Kit Tools -> http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en

Avatar of timerack

ASKER

Thanks everyone for the response. I am reviewing it and will get back to you guys soon.
Avatar of Qlemo
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.