Jody Reid
asked on
Copy a folder and its content to another drive
How do you copy a folder and all its content from one drive e.g. C:\backup to another drive e.g. Q:\backup with a batch file to run every night at 12 o'clock.
If you provide more information on your requirements, we may be able to help further.
ASKER
I have a back running everynight on one server from one program. This is a program that backup to the Q drive in a folder called \\mayo\harvbak. I need to batch file copy this folder to another server and in to another folder everynight to \\westmeath\Backup. This is over the network. Is this posible.
Thank you.
Jody
Thank you.
Jody
Hi jodyreid, elaborating leew's suggestion,
create a batch file as follows with a name, say mycopy.bat :
XCOPY /S /Y /C /Q /H C:\backup\* Q:\backup
Then goto Start --> Programs --> Accessories --> System Tools --> Sheduled Tasks
Add New task, browse your file, then select every day and set the time as 12:00 AM
---
Harish
create a batch file as follows with a name, say mycopy.bat :
XCOPY /S /Y /C /Q /H C:\backup\* Q:\backup
Then goto Start --> Programs --> Accessories --> System Tools --> Sheduled Tasks
Add New task, browse your file, then select every day and set the time as 12:00 AM
---
Harish
jodyreid, you can use AT command to do that...
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx
jodyreid,
at \\computername 00:00 /every:M,T,W,Th,F,S,Su "XCOPY /S /Y /C /Q /H C:\backup\* Q:\backup"
at \\computername 00:00 /every:M,T,W,Th,F,S,Su "XCOPY /S /Y /C /Q /H C:\backup\* Q:\backup"
mgh_mgharish, the at command will probably not work, because the system user will have no access to the network drive.
Scheduled Tasks would be fine, because you can enter the user under which the command is executed. But instead of specifying drive Q: it is better to use the unc path (like \\westmeath\Backup)
Scheduled Tasks would be fine, because you can enter the user under which the command is executed. But instead of specifying drive Q: it is better to use the unc path (like \\westmeath\Backup)
ok so lets try the following
first of all you need to map the drive
so lets creat the batch file
this will disconnect any current drives to prevent from copying the file to the wron location
net use g: /d
rem begin drive mapping
net use g: \\192.168.1.250\c$ password /user:Administrator /persistent:no
rem copying file
copy C:\backup\* g:\backup
net use g: /d
then schedule it through task manager and use your criteria
first of all you need to map the drive
so lets creat the batch file
this will disconnect any current drives to prevent from copying the file to the wron location
net use g: /d
rem begin drive mapping
net use g: \\192.168.1.250\c$ password /user:Administrator /persistent:no
rem copying file
copy C:\backup\* g:\backup
net use g: /d
then schedule it through task manager and use your criteria
1. Map the Backfolder as a drive say [K:]
2. xcopy k:\*.* c:\backupofserver /e
Regards
Subramanian
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<copy command> "C:\BACKUP\*.*" "Q:\BACKUP"
Then schedule the copy with the Task Scheduler in control panel (Scheduled Tasks)