'* 19.07.2006 Dim lsPotArhiv, lsPotArhivNet, lbSrvNaDp Set WshShell = WScript.CreateObject("WScript.Shell") Set oFso = CreateObject("Scripting.FileSystemObject") lbSrvNaDp = True IF lbSrvNaDp = True Then '******** Poganja se na tistem računalniku kot je baza in SQL Server (Server je na Dp - DelovniPostaji) lsPotArhiv="E:\FinWIN\Finesa.Xp\ArhivSQL\AutoArhiv\" lsPotArhivNet="" Else '* ****** Poganja se na delovni postaji, baza in SQL Server sta na serverju lsPotArhiv="E:\FinWIN\Finesa.Xp\ArhivSQL\AutoArhiv\" lsPotArhivNet="\\FinServer\Finesa.Xp\ArhivSQL\AutoArhiv\" End IF On Error Resume Next Set objExplorer = Wscript.CreateObject("InternetExplorer.Application") If Err.Number = 0 Then objExplorer.Navigate "about:blank" objExplorer.Toolbar = 0 objExplorer.StatusBar = 0 objExplorer.Width = 410 objExplorer.Height = 100 objExplorer.Left = 400 objExplorer.Top = 200 Do While (objExplorer.Busy) Wscript.Sleep 200 Loop objExplorer.Visible = 1 objExplorer.Document.Title = "Arhiviranje podatkovne zbirke Finesa" objExplorer.Document.Body.InnerHTML = "Arhiviranje je v teku. Počakajte trenutek ..." End If WshShell.Run "C:\Finesa.XP\Internet\osql -S FinServer -U Arhivar -P -i " & lsPotArhiv & "BackUpFinesa.sql",7,true IF lbSrvNaDp = True Then '* Če se arhiv poganja na istem računalniku kot je baza '* Dat na tem računalniku se zaZipa in Dat se pobriše WshShell.Run "C:\Finesa.XP\Internet\infozip-win.exe " & lsPotArhiv & "FinesaSql.zip " & lsPotArhiv & "FinesaArhiv.dat",7,True WshShell.Run "C:\Finesa.XP\Internet\infozip-win.exe " & lsPotArhiv & "Finesa06Sql.zip " & lsPotArhiv & "Finesa06Arhiv.dat",7,True Else '* Če se arhiv poganja na delovni postaji, baza pa je na serverju. '* Dat na serverju se zaZipa na delovno postajo in Dat na serverju se pobriše WshShell.Run "C:\Finesa.XP\Internet\infozip-win.exe " & lsPotArhiv & "FinesaSql.zip " & lsPotArhivNet & "FinesaArhiv.dat",7,True WshShell.Run "C:\Finesa.XP\Internet\infozip-win.exe " & lsPotArhiv & "Finesa06Sql.zip " & lsPotArhivNet & "Finesa06Arhiv.dat",7,True IF (oFso.FileExists(lsPotArhivNet & "FinesaArhiv.dat")) = true then if (oFso.FileExists(lsPotArhiv & "FinesaSql.zip")) = True then oFso.DeleteFile lsPotArhivNet & "FinesaArhiv.dat" End If End If End IF '* Za bazo Finesa IF (oFso.FileExists(lsPotArhiv & "FinesaArhiv.dat")) = true then if (oFso.FileExists(lsPotArhiv & "FinesaSql.zip")) = True then oFso.DeleteFile lsPotArhiv & "FinesaArhiv.dat" End If End If IF oFso.FileExists(lsPotArhiv & "FinesaSql07.zip") = True Then oFso.DeleteFile lsPotArhiv & "FinesaSql07.zip" End If IF oFso.FileExists(lsPotArhiv & "FinesaSql06.zip") = True Then oFso.MoveFile lsPotArhiv & "FinesaSql06.zip ", lsPotArhiv & "FinesaSql07.zip" End If IF oFso.FileExists(lsPotArhiv & "FinesaSql05.zip") = True Then oFso.MoveFile lsPotArhiv & "FinesaSql05.zip ", lsPotArhiv & "FinesaSql06.zip" End If IF oFso.FileExists(lsPotArhiv & "FinesaSql04.zip") = True Then oFso.MoveFile lsPotArhiv & "FinesaSql04.zip ", lsPotArhiv & "FinesaSql05.zip" End If IF oFso.FileExists(lsPotArhiv & "FinesaSql03.zip") = True Then oFso.MoveFile lsPotArhiv & "FinesaSql03.zip ", lsPotArhiv & "FinesaSql04.zip" End If IF oFso.FileExists(lsPotArhiv & "FinesaSql02.zip") = True Then oFso.MoveFile lsPotArhiv & "FinesaSql02.zip ", lsPotArhiv & "FinesaSql03.zip" End If IF oFso.FileExists(lsPotArhiv & "FinesaSql01.zip") = True Then oFso.MoveFile lsPotArhiv & "FinesaSql01.zip ", lsPotArhiv & "FinesaSql02.zip" End If IF oFso.FileExists(lsPotArhiv & "FinesaSql.zip") = True Then oFso.MoveFile lsPotArhiv & "FinesaSql.zip ", lsPotArhiv & "FinesaSql01.zip" End If '* Za bazo Finesa06 IF (oFso.FileExists(lsPotArhiv & "Finesa06Arhiv.dat")) = true then if (oFso.FileExists(lsPotArhiv & "Finesa06Sql.zip")) = True then oFso.DeleteFile lsPotArhiv & "Finesa06Arhiv.dat" End If End If IF oFso.FileExists(lsPotArhiv & "Finesa06Sql07.zip") = True Then oFso.DeleteFile lsPotArhiv & "Finesa06Sql07.zip" End If IF oFso.FileExists(lsPotArhiv & "Finesa06Sql06.zip") = True Then oFso.MoveFile lsPotArhiv & "Finesa06Sql06.zip ", lsPotArhiv & "Finesa06Sql07.zip" End If IF oFso.FileExists(lsPotArhiv & "Finesa06Sql05.zip") = True Then oFso.MoveFile lsPotArhiv & "Finesa06Sql05.zip ", lsPotArhiv & "Finesa06Sql06.zip" End If IF oFso.FileExists(lsPotArhiv & "Finesa06Sql04.zip") = True Then oFso.MoveFile lsPotArhiv & "Finesa06Sql04.zip ", lsPotArhiv & "Finesa06Sql05.zip" End If IF oFso.FileExists(lsPotArhiv & "Finesa06Sql03.zip") = True Then oFso.MoveFile lsPotArhiv & "Finesa06Sql03.zip ", lsPotArhiv & "Finesa06Sql04.zip" End If IF oFso.FileExists(lsPotArhiv & "Finesa06Sql02.zip") = True Then oFso.MoveFile lsPotArhiv & "Finesa06Sql02.zip ", lsPotArhiv & "Finesa06Sql03.zip" End If IF oFso.FileExists(lsPotArhiv & "Finesa06Sql01.zip") = True Then oFso.MoveFile lsPotArhiv & "Finesa06Sql01.zip ", lsPotArhiv & "Finesa06Sql02.zip" End If IF oFso.FileExists(lsPotArhiv & "Finesa06Sql.zip") = True Then oFso.MoveFile lsPotArhiv & "Finesa06Sql.zip ", lsPotArhiv & "Finesa06Sql01.zip" End If On Error Resume Next objExplorer.Quit 'MsgBox "Podatkovna zbirka Finesa je arhivirana. ",, "Finesa"