I have the following script:
dim filesys, filesys1,newfolder, mydate,s,mymonth,r,t,f,y,d
'Check for year folder
f = "\\ntfs3\vol2\callrecords\"
myyear = DatePart("yyyy", Now)
f = f & myyear & "\"
set filesys1=CreateObject("Scripting.FileSystemObject"
If filesys1.FolderExists(f) Then
Else
newfolder = filesys1.CreateFolder(f)
End If
'Check for month folder
t = DatePart("m", Now)
mymonth = MonthName( t , False )
y = f & mymonth & "\"
If Not filesys1.FolderExists(f) Then
newfolder = filesys.CreateFolder(f)
End If
'Check for day folder
myDate = FormatDateTime((Now - 1), vbshortdate)
'r = y & mydate & "\"
'set filesys1=CreateObject("Scripting.FileSystemObject"
'If Not filesys1.FolderExists(r) Then
' newfolder = filesys1.CreateFolder(r)
'End If
' Move files from ATL Dialer
set filesys1=CreateObject("Scripting.FileSystemObject"
s = "\\dialer01\agentrec\" & myyear & "\" & mymonth & "\" & mydate & "\"
d = y
filesys1.MoveFolder """ & s & """, """ & d & """
When I run everything works except for the last part. I keep getting an error stating the line 32 (movefolder line) path not found.
Any ideas what I'm doing wrong. I assumed that I have to use quotes so that the statement knows the directory path.
dim filesys, filesys1,newfolder, mydate,s,mymonth,r,t,f,y,d
'Check for year folder
f = "\\ntfs3\vol2\callrecords\"
myyear = DatePart("yyyy", Now)
f = f & myyear & "\"
set filesys1=CreateObject("Scripting.FileSystemObject"
If filesys1.FolderExists(f) Then
Else
newfolder = filesys1.CreateFolder(f)
End If
'Check for month folder
t = DatePart("m", Now)
mymonth = MonthName( t , False )
y = f & mymonth & "\"
If Not filesys1.FolderExists(f) Then
newfolder = filesys.CreateFolder(f)
End If
'Check for day folder
myDate = FormatDateTime((Now - 1), vbshortdate)
'r = y & mydate & "\"
'set filesys1=CreateObject("Scripting.FileSystemObject"
'If Not filesys1.FolderExists(r) Then
' newfolder = filesys1.CreateFolder(r)
'End If
' Move files from ATL Dialer
set filesys1=CreateObject("Scripting.FileSystemObject"
s = "\\dialer01\agentrec\" & myyear & "\" & mymonth & "\" & mydate & "\"
d = y
filesys1.MoveFolder """ & s & """, """ & d & """
When I run everything works except for the last part. I keep getting an error stating the line 32 (movefolder line) path not found.
Any ideas what I'm doing wrong. I assumed that I have to use quotes so that the statement knows the directory path.