ソース PROG02.VBS
Set objFS = CreateObject("Scripting.FileSystemObject")
Folder = "C:\saigai\recv"
Folder2 = "C:\saigai\send\"
Folder3 = "C:\saigai\dest\"
TimeCtr = 0
Time_str = Year(Now) & Right(("0" & CStr(Month(Now)+0)),2) & Right(("0" & CStr(Day(Now)+0)),2) & "_" & Right(("0" & CStr(Hour(Now)+0)),2) & Right(("0" & CStr(Minute(Now)+0)),2) & Right(("0" & CStr(Second(Now)+0)),2) '← YYYYMMDD_HHMMSS_NNN を作成し、各桁をそろえます。
'----------------------------------------------------------
Set objFolder = objFS.GetFolder(Folder)
For Each objFC in objFolder.SubFolders
Folder_str = objFC.Name
TimeCtr = TimeCtr + 1
Time_str2 = Right(("00" & CStr(TimeCtr)),3)
OutFileName = "EDI_PRO_MAIL_" & Time_str & "_" & Time_Str2 & ".txt"
Set objTextW = objFS.CreateTextFile(Folder2 & OutFileName)
myText = "<To>"
objTextW.WriteLine(myText)
Set objTextR = objFS.OpenTextFile(Folder3 & "destinator.txt")
Do While objTextR.AtEndOfStream <> True
myText = objTextR.Readline
objTextW.WriteLine(myText)
Loop
objTextR.Close
objTextW.WriteLine("<Subject>")
Set objText = objFS.OpenTextFile(Folder & "\" & Folder_str & "\nse_internet_edi_pro_subject.txt")
Subj_str = objText.Readline
objTextW.WriteLine(Subj_str)
objTextW.WriteLine("<Body>")
objText.Close
Set objText = objFS.OpenTextFile(Folder & "\" & Folder_str & "\nse_internet_edi_pro_body.txt")
Do While objText.AtEndOfStream <> True
myText = objText.Readline
objTextW.WriteLine(myText)
Loop
objText.Close
objTextW.Close
' MsgBox("120 削除します" & vbCR & objFile2)
Set objFile2 = objFS.GetFolder(Folder & "\" & Folder_str)
objFile2.Delete True
MsgBox(OutFileName & vbCR & "Program temporary Stopped.")
Next
'-------------------------------------------------------
'MsgBox("200 MailConnect 送信を起動します")
Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.Run("""C:\Program Files\Internet_EDI_Pro\PROGRAM\EDI_Send_MailConnect.exe"" mcj0003/s,1,True")
'MsgBox("210 終了します")
E-mail : webmaster@global.co.jp
Copyright (C) Global Network Ltd.1995-2005, All Rights Reserved.
本ホームページに掲載の会社名および製品名は各社の登録商標または商標です。 |