Login | |
|
 |
VB file naming script - 10/30/2004 7:07:16 PM
|
|
 |
|
| |
vir_pat98
Posts: 8
Score: 0
Joined: 10/22/2004
From:
Status: offline
|
hi, iam running a backupscript as follows on Error Resume Next Dim oFile,FS Dim TempDate Dim sTruePath,Bak_Path Dim oDay,oMonth oDay=Day(date) oMonth=month(date) IF len(oMonth)=1 Then oMonth="0" & oMonth end if IF len(ODay)=1 Then oDay="0" & oDay End if sTruePath="D:\Drushti\Daily_SQL_Backup" Bak_Path="D:\Drushti\Daily_SQL_Backup\Zip_Data\" ' Set FS=CreateObject("Scripting.FileSystemObject") If (fs.FolderExists(sTruePath)) Then Set oFile = fs.CreateTextFile(sTruePath & "\sql.bat", True) oFile.writeline "@ECHO OFF" oFile.writeline "Del " & bak_Path & "*.zip" oFile.writeline "Del sql.lst" For X = 1 to 7 theDate = DateAdd("d", -X, Date) themonth = month(theDate) theyear = year(theDate) theday = day(theDate) oFile.writeline "Dir/o/s/b *_db_" & theyear & themonth & theday & "*.BAK >> sql.lst" oFile.writeline "" Next oFile.writeline "C:\Progra~1\Winzip\wzzip " & Bak_Path & year(date) & oMonth & oDay & ".ZIP @sql.lst -a+" oFile.Close Set oFile = Nothing End If Set FS=Nothing now, what i want is to edit this line "oFile.writeline "C:\Progra~1\Winzip\wzzip " & Bak_Path & year(date) & oMonth & oDay & ".ZIP @sql.lst -a+"" this makes a zip file with the name containing current date, this zip file contains previous 7 days sql databases backup. so i wanted to name it like 25_nov-1_Dec.zip. how could i do this, please help me
|
|
| |
|
|
|
|
|