Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript Error

Status
Not open for further replies.

ter79

IS-IT--Management
Jul 11, 2001
106
US
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.
 
Have you tried not using quotes in the MoveFolder method? What makes you think it needs quotes?

Syntax is:

object.MoveFolder ( source, destination );

You would only need quotes if you were passing it a literal string but you are using variables.

Hope this helps.

Thanks,
Sunny
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top