不要な文字が多く含まれる長いファイル名があり、これを減らす必要があり、昨日の日付を追加する必要があります。私はその部分を理解しました-Googleに感謝します。次に、ファイルを現在の場所から別のネットワークの場所に移動する必要があります。これは、私が繰り返し失敗する部分です。ファイルが実際に作成されているのではなく、変数が定義されているだけだと思います。私はこれを長い間見てきましたが、エラーは見られません。誰かが私が見落としていることを指摘できますか?
必要な部品はすべて以下に掲載されていると思います -
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objMessage = CreateObject("CDO.Message")
Set objShell = WScript.CreateObject("WScript.Shell")
Set objshell = CreateObject("Wscript.shell")
'On Error Resume Next
'Get current date
'-----------------------
strMonth = Month(Date)
If len(strMonth) = 1 Then
strMonth = "0" & strMonth
End if
strDay = Day(Date)
If Len(strDay) = 1 Then
strDay = "0" & strDay
End if
strYear = Year(Date)
'strHour = Hour(Time)
'strMinute = Minute(Time)
'strSecond = Second(Time)
strDate = strYear & strMonth & strDay
strPastDay = strDate -1
'-----------------------
'Specify variables for Emails
'-----------------------------
strScriptServer = "TECHOPSPC01"
strScriptPath = "\\TECHOPSPC01\C$\Scripts\CSI\Capture\..."
strScriptName = "DFX_Loans_Past_Due file Move to FSCHAUNI01"
'strToEmail = ""
'strCCEmail =
strProcessID = "[LPDR-01]"
strCustomerImpact = "LOW"
strCorporateImpact = "LOW??"
'-------------------------------
'Specify variables for File Paths
'strFromPath1 = "\\techopspc01\C$\CSIeSafeDFX\receive"
'strToPath1 = "\\fschauni01\group_share\special assets retail\special assets\past due report\"
strFromPath1 = "C:\CSIeSafeDFX\receive"
strToPath1 = "c:\treasury\Public funds\"
'Specify variable for File
strFile1 = "DFX_Loans Past Due by PDR*.xls"
strNewFile1 = "DFX_LoansPastDueByPDR"
'#######################'
If Right(strFromPath1, 1) <> "\" Then
strFromPath1 = strFromPath1 & "\"
End If
objShell.Run "cmd /c move ""C:\CSIeSafeDFX\receive\DFX_Loans Past Due by PDR*.xls"" C:\CSIeSafeDFX\receive\DFX_LoansPastDueByPDR"
Wscript.Sleep 4000
strNewFile2 = "DFX_Loans Past Due By PDR" & strPastDay & ".xls"
strNewFile2 = strNewFile1 & strPastDay & ".xls"
objFSO.CopyFile strFromPath1 & strNewFile2, strToPath1, True
' objFSO.DeleteFile strFromPath1 & NewFile1
blnEmailNotification = true