windows xp xcopy

hi experts,

The user PC is
The user share folder is c:\share

The remote backup PC is
The backup folders are

How do i script xcopy to schedule a backup of c:\share, once a week to folders like week1, week2, week3, week4 and week5 and overwrite the contents in each folder once a month?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

User scheduler application to call the batch file that contain your xcopy command and logic etc.

better way would be to create 4 backup jobs which are scheduled on you specific time and execute the copyjob to the specific week

Scheduled Task 1:
xcopy C:\share \\\c$\backup\week1 /S /E /Y

Scheduled Task 2:
xcopy C:\share \\\c$\backup\week2 /S /E /Y

Scheduled Task 3:
xcopy C:\share \\\c$\backup\week3 /S /E /Y

Scheduled Task 4:
xcopy C:\share \\\c$\backup\week4 /S /E /Y
If you want a script anyway whihc is executed once per week with one scheduled task, then check the code below>
set objShell = CreateObject("Wscript.Shell")

On Error Resume Next
strLastWeek = objShell.RegRead ("HKLM\Software\MyCopyJob\LastWeek")
wscript.echo strLastWeek
select case(strLastWeek)

Case "Week1"
      objShell.Run "xcopy C:\share \\\c$\backup\week1 /S /E /Y",0,true
      objShell.RegWrite "HKLM\Software\MyCopyJob\LastWeek","Week2","REG_SZ"
case "Week2"
      objShell.Run "xcopy C:\share \\\c$\backup\week2 /S /E /Y",0,true
      objShell.RegWrite "HKLM\Software\MyCopyJob\LastWeek","Week3","REG_SZ"
Case "Week3"
      objShell.Run "xcopy C:\share \\\c$\backup\week3 /S /E /Y",0,true
      objShell.RegWrite "HKLM\Software\MyCopyJob\LastWeek","Week4","REG_SZ"
Case "Week4"
      objShell.Run "xcopy C:\share \\\c$\backup\week4 /S /E /Y",0,true
      objShell.RegWrite "HKLM\Software\MyCopyJob\LastWeek","Week1","REG_SZ"
Case Else
      'Not executed yet starting with week 1
      objShell.Run "xcopy C:\share \\\c$\backup\week1 /S /E /Y",0,true
      objShell.RegWrite "HKLM\Software\MyCopyJob\LastWeek","Week1","REG_SZ"
End Select

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Need further information?
kenny_klbnAuthor Commented:
Hi merowinger,
sorry for late reply. Im still testing the script. will feedback once done.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.