반응형
베타섭에서 압축한 것을 가져와서 압축을 푸는것..
주석을 주렁주렁 많이 단다고 좋은 것도 아니고.. 모르는 사항이 있으면 물어보도록~~ ㅡ,.ㅡ;
Option Explicit
Dim currDate, ConvertDate
Dim objFSO, objShell, srcFolder
Dim intReturn, ftpLog, strLog
currDate = DateAdd("d", 0 , Date)
ConvertDate = ConvertDate8(currDate)
srcFolder = "C:\xodim\UpdateSrc"
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject("WScript.Shell")
ftpLog = "open 111.111.111.111" & vbCRLF
ftpLog = ftpLog & "ftp 계정" & vbCRLF
ftpLog = ftpLog & "ftp 패스워드" & vbCRLF
ftpLog = ftpLog & "binary" & vbCRLF
ftpLog = ftpLog & "prompt" & vbCRLF
ftpLog = ftpLog & "cd /Update" & vbCRLF
ftpLog = ftpLog & "get " & ConvertDate & ".arj" & vbCRLF
ftpLog = ftpLog & "bye " & vbCrLf
Set objLog = objFSO.OpenTextFile(srcFolder & "\" & "ftp.txt", 2, True)
objlog.Write ftpLog
objlog.Close
intReturn = objShell.Run("ftp -s:ftp.txt", 0, True)
if intReturn <> 0 then
If Err.Number <> 0 Then
strLog = "Err.Number : " & Err.Number & vbCrLf
strLog = strLog & "Err.Description : " & Err.Description & vbCrLf
End If
Else
strLog = "########### " & currDate & " 업데이트 ############" & vbCrLf
If objFSO.FileExists(srcFolder & "\" & ConvertDate & ".arj") Then
strLog = strLog & ConvertDate & ".arj 파일을 가져왔습니다." & vbCrLf
objShell.Run("arj32 x -y " & ConvertDate )
strLog = strLog & ConvertDate & ".arj 압축 파일을 풀었습니다." & vbCrLf
Else
strLog = strLog & "업데이트가 없습니다. " & vbCrLf
End If
End If
Function ConvertDate8(Byval currDate)
If IsDate(currDate) Then
ConvertDate8 = Replace(FormatDateTime(currDate, 2), "-", "")
Else
ConvertDate8 = ""
End If
End Function
Dim objLog, strScriptFullName
strScriptFullName = WScript.ScriptFullName
Set objLog = objFSO.OpenTextFile(strFolder & "\log\" & Replace(FormatDateTime(Date, 2), "-", "") & ".log", 2, True)
objLog.Write strLog
objLog.Close
If objFSO.FileExists(srcFolder & "\" & ConvertDate & ".arj") Then
strLog = strLog & ConvertDate & ".arj 파일을 가져왔습니다." & vbCrLf
objShell.Run("arj32 x -y " & ConvertDate )
strLog = strLog & ConvertDate & ".arj 압축 파일을 풀었습니다." & vbCrLf
Else
strLog = strLog & "업데이트가 없습니다. " & vbCrLf
End If
End If
Function ConvertDate8(Byval currDate)
If IsDate(currDate) Then
ConvertDate8 = Replace(FormatDateTime(currDate, 2), "-", "")
Else
ConvertDate8 = ""
End If
End Function
Dim objLog, strScriptFullName
strScriptFullName = WScript.ScriptFullName
Set objLog = objFSO.OpenTextFile(strFolder & "\log\" & Replace(FormatDateTime(Date, 2), "-", "") & ".log", 2, True)
objLog.Write strLog
objLog.Close
반응형
'기술 공부 노트 > 개발이야기' 카테고리의 다른 글
윈도우2003에서 CVSNT + TortoiseCVS 설치하기(1) (0) | 2007.11.28 |
---|---|
마지막.. 압축해제한 것을 업데이트 하자~ (0) | 2007.11.16 |
압축하는 스크립트 (0) | 2007.11.16 |
이런~~ 자바스크립트~! (1) | 2007.11.16 |
문자열 비교 (1) | 2007.11.16 |