Rem The VBScript was created by Boris Sirotin All Covered 02/02/2007
Rem Copy stsadm.exe to same folder with the script
Rem The script should be scheduled as a task
Rem It will backup sharepoint to folder, by Friday it will run full backup and delete all backups
Rem older then 2 weeks. All other days it will run differential
Dim weekdate, weekdate1, command1, command2, oFSO, backpath1,backpath2,myFolder, f
Set Sh = Wscript.CreateObject("Wscript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
command1="stsadm -o backup -directory " +backpath + " -backupmethod full"
command2="stsadm -o backup -directory " +backpath + " -backupmethod differential"
if weekdate=6 Then
Sh.run command1, 1
Sh.run command2, 1
Function CleanUp (Folder)
For Each f In Folder.SubFolders
If DateDiff("d",Now,f.DateCreated,vbMonday)>2 then