The code shown below suppose to create the file name and the date/time stamp but it is giving me errors.
Error Message:
Script: C:\Documents and Settings\tim\desktop\Final_Rev.vbs
Line: 5
Char: 17
Error: The system cannot find the file specified.
Code: 80070002
Source: (null)
Script:
Option Explicit
Dim objShell : Set objShell = WScript.CreateObject("WScript.Shell")
Dim strCMD : strCMD = "stsadm -o backup -url -filename C:\data_" & Convert_Date(Date) & "_0805.bak"
WScript.Echo strCMD
Dim errReturn : errReturn = objSHell.Run(strCMD, 0, True)
If errReturn = 0 Then
MsgBox "Backup reported no errors"
Else
MsgBox "Backup exited with error code: " & errReturn
End If
Function Convert_Date(dtm_Date)
Convert_Date = Right("0" & Month(dtm_Date), 2) &_
Right("0" & Day(dtm_Date), 2) &_
Year(dtm_Date)
End Function
Please advice.
Thanks.
Error Message:
Script: C:\Documents and Settings\tim\desktop\Final_Rev.vbs
Line: 5
Char: 17
Error: The system cannot find the file specified.
Code: 80070002
Source: (null)
Script:
Option Explicit
Dim objShell : Set objShell = WScript.CreateObject("WScript.Shell")
Dim strCMD : strCMD = "stsadm -o backup -url -filename C:\data_" & Convert_Date(Date) & "_0805.bak"
WScript.Echo strCMD
Dim errReturn : errReturn = objSHell.Run(strCMD, 0, True)
If errReturn = 0 Then
MsgBox "Backup reported no errors"
Else
MsgBox "Backup exited with error code: " & errReturn
End If
Function Convert_Date(dtm_Date)
Convert_Date = Right("0" & Month(dtm_Date), 2) &_
Right("0" & Day(dtm_Date), 2) &_
Year(dtm_Date)
End Function
Please advice.
Thanks.