I am trying to write a vbscript to automatically backup my Sharepoint. I am testing it by opening a command prompt as administrator and then running the script. The script correctly creates the backup sub-directory however, it doesn't appear to launch stsadm as it doesn't create any backup files and it doesn't show as running in Taks manager - All Users.
How can I test this script and ensure it works? I have attached the script incase i made an error in it.
' Tool for planning and automating files/entries
' Microsoft Office SharePoint Server 2007
' Will generate file entry names with the following style: YYYYMMDD
' E.g.: 20070228
Const BackupPath = "D:\SharePoint_Backup\"
Const C_SiteURL = "http://companyweb"
Const C_NamePrefix = "SharePoint_"
Const C_SharePointBin = "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin"
Dim fso, folder, filedate, f, file, filesys
Set fso = CreateObject("Scripting.FileSystemObject")
if Not fso.FolderExists(BackupPath) then
WScript.Echo "The folder " & BackupPath & " does not exist!"
Set folder = fso.GetFolder(BackupPath)
filedate = now
Set f = Nothing
' Assigns a name of the new file
sBackupPrefix = BackupPath & year(now) & right("00" & Month(now),2) & right("00" & day(now),2)
Set folder = filesys.CreateFolder(sBackupPrefix)
Set objShell = CreateObject("WScript.Shell")
'msgbox ("C_SiteURL = " & C_SiteURL & ", filename = " & sBackupPrefix )
strcmd = C_SharePointBin & "\stsadm.exe -o backup -url " & C_SiteURL & " -filename " & sBackupPrefix & "\companyweb.bak -backupmethod full -includeusersecurity"
WScript.Echo "Backup of site collection successful"
Set objshell = nothing