I'm doing a process in VBScript.
I need to copy some files from one folder to another.
That is already done, but the problem is that the name of the folder from which it is copied varies every week, because it corresponds to the date. That's right: Sem_20170228
.
Then I need that within the string of the name, add that variable. The date is formatted so that YYYYMMD appears like this and the code was messed up
Code:
Option Explicit
Dim g_oSB : Set g_oSB = CreateObject("System.Text.StringBuilder")
Function sprintf(sFmt, aData)
g_oSB.AppendFormat_4 sFmt, (aData)
sprintf = g_oSB.ToString()
g_oSB.Length = 0
End Function
Dim fso
Dim dt : dt = now()
'WScript.Echo sprintf("{0:yyyyMMdd}", Array(dt))
Set fso = CreateObject("Scripting.FileSystemObject")
If
filesys.FileExists("C:Bibliotecas\Documentos\Sem_" +dt "\*.pdf")
Then
'filesys.CopyFile "C:Bibliotecas\Documentos\Sem_" +dt "\*.pdf", "C:\Users\alpnheg\Documents\TUTORIALES"