hello all,
Let me briefly explain how the script is suppossed to work and how it's not working.
1.
We receive daily files from our client for processing and all files received are named
filename04
and the script converts each file to
filename04_20041110.txt
which are then moved to a shared folder "2004 Files" folder on a server. All files with a "04" on the end are working fine as per the script
2.
The problem is with files with "05" on the end. As you can see by the script I modified it as far as I could but it's not working. (not good with this coding and here's where your help is necessary)
What is currently happening with "05" files is that the files are being moved to the root of the machine that receives And nothing is being appended to the end like 04 filesthem and not moved to the "2005 Folder" (as 04 file are) folder as per the script. And when the client sends multiple files the same day all "05" files are overwritten.
I really hope you guys can help on thisone but most importantly I hope you undertand my problem.
Thanks All
Let me briefly explain how the script is suppossed to work and how it's not working.
1.
We receive daily files from our client for processing and all files received are named
filename04
and the script converts each file to
filename04_20041110.txt
which are then moved to a shared folder "2004 Files" folder on a server. All files with a "04" on the end are working fine as per the script
2.
The problem is with files with "05" on the end. As you can see by the script I modified it as far as I could but it's not working. (not good with this coding and here's where your help is necessary)
What is currently happening with "05" files is that the files are being moved to the root of the machine that receives And nothing is being appended to the end like 04 filesthem and not moved to the "2005 Folder" (as 04 file are) folder as per the script. And when the client sends multiple files the same day all "05" files are overwritten.
I really hope you guys can help on thisone but most importantly I hope you undertand my problem.
Thanks All
Code:
Option Explicit 'force explicit variable declaration
On Error Resume Next 'on error continue at next statement
' Initialize variables
Dim nowMonth, nowDay, nowYear
Dim now
Dim ConfirmTxT, ConfRptTxt, PostCardTxT, OutFileTxT, Confirm04TXT, Confirm05TXT, Confirmcl04TXT, Confirmcl05TXT, Confirmny04TXT, Confirmny05TXT, ConfirmrptTXT
Dim FSO
now = date
nowMonth = Month(now)
nowDay = Day(now)
nowYear = Year(now)
ConfirmTxT = "i:\wcom\confirm_" & nowYear & nowMonth & nowDay & ".txt"
ConfRptTxT = "i:\wcom\confrpt_" & nowYear & nowMonth & nowDay & ".txt"
PostCardTxT = "i:\wcom\postcard_" & nowYear & nowMonth & nowDay & ".txt"
OutFileTxT = "i:\wcom\confirmcl_" & nowYear & nowMonth & nowDay & ".txt"
'2004 Files
Confirm04TXT = "i:\wcom\2004 Files\confirm04_" & nowYear & nowMonth & nowDay & ".txt"
Confirmcl04TXT = "i:\wcom\2004 Files\confirmcl04_" & nowYear & nowMonth & nowDay & ".txt"
Confirmny04TXT = "i:\wcom\2004 Files\confirmny04_" & nowYear & nowMonth & nowDay & ".txt"
ConfirmrptTXT = "i:\wcom\2004 Files\confirmrpt_" & nowYear & nowMonth & nowDay & ".txt"
'2005 Files
Confirm05TXT = "i:\wcom\2005 Files\confirm05_" & nowYear & nowMonth & nowDay & ".txt"
Confirmcl05TXT = "i:\wcom\2005 Files\confirmcl05_" & nowYear & nowMonth & nowDay & ".txt"
Confirmny05TXT = "i:\wcom\2005 Files\confirmny05_" & nowYear & nowMonth & nowDay & ".txt"
ConfirmrptTXT = "i:\wcom\2005 Files\confirmrpt_" & nowYear & nowMonth & nowDay & ".txt"
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFile "g:\ftp\public\confirm.txt", ConfirmTxT
FSO.CopyFile "g:\ftp\public\confirmrpt.txt", ConfRptTxT
FSO.CopyFile "g:\ftp\public\postcard.txt", PostCardTxT
FSO.CopyFile "g:\ftp\public\confirmcl.txt", OutFileTxT
'2004 Files
FSO.CopyFile "g:\ftp\public\confirm04.txt", Confirm04TXT
FSO.CopyFile "g:\ftp\public\confirmcl04.txt", Confirmcl04TXT
FSO.CopyFile "g:\ftp\public\confirmny04.txt", Confirmny04TXT
FSO.CopyFile "g:\ftp\public\confirmrpt.txt", ConfirmrptTXT
'2005 Files
FSO.CopyFile "g:\ftp\public\confirm05.txt", Confirm05TXT
FSO.CopyFile "g:\ftp\public\confirmcl05.txt", Confirmcl05TXT
FSO.CopyFile "g:\ftp\public\confirmny05.txt", Confirmny05TXT
FSO.CopyFile "g:\ftp\public\confirmrpt.txt", ConfirmrptTXT
FSO.DeleteFile("g:\ftp\public\confirm.txt")
FSO.DeleteFile("g:\ftp\public\confrpt.txt")
FSO.DeleteFile("g:\ftp\public\postcard.txt")
FSO.DeleteFile("g:\ftp\public\confirmcl.txt")
'2004 Files
FSO.DeleteFile("g:\ftp\public\confirm04.txt")
FSO.DeleteFile("g:\ftp\public\confirmcl04.txt")
FSO.DeleteFile("g:\ftp\public\confirmny04.txt")
FSO.DeleteFile("g:\ftp\public\confirmrpt.txt")
'2005 Files
FSO.DeleteFile("g:\ftp\public\confirm05.txt")
FSO.DeleteFile("g:\ftp\public\confirmcl05.txt")
FSO.DeleteFile("g:\ftp\public\confirmny05.txt")
FSO.DeleteFile("g:\ftp\public\confirmrpt.txt")