0
私はVBScriptを初めて使用しています。私はスクリプトについていくつかの助けが必要です。私は毎日VBScriptで3つのファイルだけを取得する必要があります。現在、私のスクリプトはC:\ Windows \ Logs \ WindowsServerBackupからすべてを引き出していますが、現在の日だけに制限する必要があります(Backup-05-05-2017_11-06-13.log、Backup_Operations-05-05-2017_17 -52-06.logおよびBackup_Error-05-05-2017_17-56-06.log)。現在の日付のパラメータを作成する方法がわかりません。ここでVBScriptで現在の日のログを取り出す方法
は、私がこれまで持っているものです。
Option Explicit
Const c_RoboLogDirectory = "D:\RoboLogs"
Const c_LogFileDirectory = "C:\Windows\Logs\WindowsServerBackup"
Dim fldLogFiles
Dim flsLogFiles
Dim fldRoboLogs
Dim flsRoboLogs
Dim objEmail
Dim objFSO
Dim strFile
Dim strFile1
objEmail.From = c_Sender
objEmail.To = c_Receiver
objEmail.Subject = c_Subject
' get all the files within the folder and attach them to the email
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set fldLogFiles = objFSO.GetFolder(c_LogFileDirectory)
Set flsLogFiles = fldLogFiles.Files
Set fldRoboLogs = objFSO.GetFolder(c_RoboLogDirectory)
Set flsRoboLogs = fldRoboLogs.Files
For Each strFile In flsLogFiles
objEmail.AddAttachment strFile
Next
For Each strFile1 In flsRoboLogs
objEmail.AddAttachment strFile1
Next
ありがとうございました! – liquidsgi