07-12-2007, 05:19 PM
|
#3 |
| ╢║║║▬▬▬▬▬▬▬║║║╟
Join Date: Aug 2006 Age: 25 Posts: 718 |
Quote:
intMonth = Month(date)
intYear = Year(Date)
intDay = Day(date)
intHour = Hour(time)
if intMonth < 10 then
intMonth = 0 & intmonth
end if
if intDay < 10 then
intDay = 0 & intDay
end if
if intHour < 10 then
intHour = 0 & intHour
end if
wscript.Echo intMonth
wscript.Echo intYear
wscript.Echo intDay
wscript.Echo intHour
strFolderName = intYear & intMonth & intDay
strFileName = "*" & intYear & intMonth & intDay & intHour & "*.trn"
strZipName = intYear & intMonth & intDay & intHour & ".zip"
strPathName = ""
strQuote = """"
wscript.echo strFolderName
wscript.echo strFileName
wscript.echo strZipName
'Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Set objFile = objFSO.OpenTextFile("", ForReading)
'strContents = objFile.ReadAll
'objFile.Close
strZipLine = "pkzipc -add " & strPathName & strFolderName & "\" & strZipName & " " & strPathName & strFolderName & "\" & strFileName
strCopyLine = "robocopy " & strPathName & strFolderName & " " & strZipName & " /CopyALL /R:10 /W:1 /V /LOG+:" & strFolderName & ".log"
wscript.echo strFirstLine
Set objFile = objFSO.CreateTextFile("", ForWriting, True)
objFile.Close
Set objFile = objFSO.OpenTextFile("", ForWriting)
objFile.WriteLine strZipLine
objFile.WriteLine strCopyLine
objFile.Close
wscript.echo strQuote
|
Sorry its long |
|
| |