add hour minute second year to file name

I am by no means completely fluent in VS scripting but this one should be that hard.  I have attached the full script below but I would think this should be as simple as changing the script below.  I have made the change but the file name isnt updating to add the Month Year change
 
HourMinuteSecond = Hour(Now) & Minute(Now) & Second(Now)
to show
HourMinuteSecondMonthYear = Hour(Now) & Minute(Now) & Second(Now) & Month(Now) & Year(Now)
and do a find replace for HourMinuteSecond to HourMinuteSecondMonthYear


For Each File In fsoFiles
            If File.Name <>  "ScanUpload.txt" Then
                  HourMinuteSecond = Hour(Now) & Minute(Now) & Second(Now)
                  FileCountProcessed = FileCountProcessed + 1
                  NameArray = Split(File.Name, "_", - 1, 1)
                  ArraySize = UBound(NameArray,1)
                  If ArraySize > 0 Then
                        Select Case ArraySize
                              
                        Case "1"
                              DocType = Trim(Mid(NameArray(1), 1, InStr(1, NameArray(1), ".") - 1))
                              AppID = Trim(NameArray(0))
                              Comment = AppID & " - " & "Auto Uploaded Document"
                              DestinationFileName = AppID & "_" & DocType & "_" & HourMinuteSecond & "AUPLD.pdf"
                              
                        Case "2"
                              DocType = Trim(NameArray(1))
                              AppID = Trim(NameArray(0))
                              Version = Trim(Mid(NameArray(2), 1, InStr(1, NameArray(2), ".") - 1))
                              Comment = AppID & " - " & "Auto Uploaded Document"
                              DestinationFileName = AppID & "_" & DocType & "_" & Version & "_" & HourMinuteSecond & "AUPLD.pdf"
                              
                        Case "3"
                              DocType = Trim(NameArray(1))
                              AppID = Trim(NameArray(0))
                              Version = Trim(NameArray(2))
                              CommentCode = Trim(Mid(NameArray(3), 1, InStr(1, NameArray(3), ".") - 1))
                              If UCase(commentcode) = "NE" Then
                                    Comment = AppID & " - " & "Non Executed Loan Closing Document"
                                    DestinationFileName = AppID & "_" & DocType & "_" & Version & "_" & CommentCode & "_" & HourMinuteSecond & "AUPLD.pdf"
                              ElseIf UCase(commentcode) = "SDW" Then
                                    Comment = AppID & " - " & "Summary Decline Worksheet"
                                    DestinationFileName = AppID & "_" & DocType & "_" & Version & "_" & CommentCode & "_" & HourMinuteSecond & "AUPLD.pdf"
                              ElseIf UCase(commentcode) = "SDL" Then
                                    Comment = AppID & " - " & "Summary Decline Letter"
                                    DestinationFileName = AppID & "_" & DocType & "_" & Version & "_" & CommentCode & "_" & HourMinuteSecond & "AUPLD.pdf"
                              Else
                                    Comment = AppID & " - " & "Auto Uploaded Document"
                                    DestinationFileName = AppID & "_" & DocType & "_" & Version & "_" & HourMinuteSecond & "AUPLD.pdf"
                              End If
                              
                        End Select
                        
                              If Len(AppID) = 11 And Mid(File.Name, 1, 1) = "L" And IsNumeric(DocType) Then
                                          On Error Resume Next
                                          fso.MoveFile DriveSpec & File.Name, Samba_DriveSpec & DestinationFileName
                                          If Err = 0 Then
                                                LogCount = LogCount+1
                                                Call WriteTransUploadFile      
                                          Else
                                                Call WriteFileErrorFile(DriveSpec & File.Name, File.Name)
                                                Err.Clear
                                          End If
                                          On Error Goto 0
                              Else
                                    If Len(AppID) = 10 And IsNumeric(AppID) And IsNumeric(DocType) Then
                                          On Error Resume Next
                                          fso.MoveFile DriveSpec & File.Name, Samba_DriveSpec & DestinationFileName
                                          If Err = 0 Then
                                                LogCount = LogCount+1
                                                Call WriteTransUploadFile
                                          Else
                                                Call WriteFileErrorFile(DriveSpec & File.Name, File.Name)
                                                Err.Clear
                                          End If
                                          On Error Goto 0
                                    Else
                                          Call WriteApplicationIDErrorFile(DriveSpec & File.Name, File.Name)
                                    End If
                              End If
                  Else
                                          Call WriteApplicationIDErrorFile(DriveSpec & File.Name, File.Name)
                  End If
                  Else
                        FileCountProcessed = FileCountProcessed + 1
                  End If
            Next
      
sbapdcirmAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BidonetCommented:
Try first by replacing

HourMinuteSecond = Hour(Now) & Minute(Now) & Second(Now)

Open in new window


with

HourMinuteSecond = Hour(Now) & Minute(Now) & Second(Now) & Month(Now) & Year(Now)

Open in new window


And see what happens
0
sbapdcirmAuthor Commented:
I was able to get the my original script to work but one question I have is does this show the Hour in a 24 hour time format for a 12 hour time format?
0
RobSampsonCommented:
Hi, instead of
Hour(Now)

use
Hour(FormatDateTime(Time, vbShortTime))

Regards,

Rob.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.