This VBScript will help you
Sub BackupDB(ByVal xServer,ByVal xDB,ByVal xUser,ByVal xPass,ByVal xFile)
Dim lSQL
Dim loCN
Set loCN = CreateObject("ADODB.Connection")
lSQL = lSQL & "Provider=SQLOLEDB.1;Password=" & xPass &";"
lSQL = lSQL & "Persist Security Info=True;User ID=" & xUser & ";"
lSQL = lSQL & "Initial Catalog=" & xDB & ";"
lSQL = lSQL & "Data Source="& xServer &";"
loCN.Open lSQL
lSQL = "BACKUP DATABASE " & xDB & " TO DISK = N'" & xFile & "' WITH
NOFORMAT, NOINIT, Name = N'" & xDB & "-Full Database Backup', Skip ,
NOREWIND, NOUNLOAD, STATS = 10"
loCN.Execute lSQL
loCN.close
End Sub
Call
BackupDB("ServerName","DBNme","UserName","Password ","d:\Backup\SQL\DBName.Bak")
dim FSO,OverWrite
Set FSO = CreateObject("Scripting.FileSystemObject")
OverWrite = True
Call FSO.CopyFile("SourcePath","DestinationPath",OverWr ite)
"LG" <>, haber iletisinde sunlari
yazdi:f211d9b1-32b0-47a4-9c2f-...
> Hi All,
>
> we have our build which gets copied to our central server
> once the build copy is completed i want to schedule a task such that
> its copies the build file to my local system
> I need to write a script for doing this..
>
>
> Can you please guide me through this
> how do i go about doing this??
>
>
> Thanks
> Ganesh
|