i need help with this vbscript i thought i was doing good until it got really complicated.I have a folder with a file with .ach at the end the file names can change daily i try creating this script that will go in the folder then copy the files rename it and move it to a different. how can i copy a wildcard file using vbscript. this is what i have so far. any help would be greatly appreciated.
thanks in advance
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
Do Until objTextFile.AtEndOfStream ' Loop until end of file.
sRecord = objTextFile.Readline ' Read line into variable.
If Mid(sRecord, 1, 1) = "9" Then
sRec9 = 1 ' EOF record found so change flag
sTotalDebit = FormatCurrency((Mid(sRecord, 32, 12) / 100),2)
sTotalCredit = FormatCurrency((Mid(sRecord, 44, 12) / 100),2)
' Close file.
If sRec9 = 0 Then
Error = MsgBox("BAD FILE - EOF record not found" & (Chr(13))) ' EOF record not found
Response = MsgBox("Please verify File is current: " _
& "OK To Transfer to Spectrum?", vbYesNo)
If Response = vbNo Then
Error = MsgBox("Transfer Aborted" & (Chr(13))) ' Abort Transfer
' End If
If filesys.FileExists("c:\ACHTEST\.ach") Then
filesys.CopyFile "c:\ACHTEST\.ach", "C:\ACHFTP\"
Error = MsgBox("Transfer to HP Successful" & (Chr(13))) '