***SOLVED***
I'm trying to backup a folder using a vb script that will create a folder with the current date then copy the contents of the source into it. I've been working so hard on learning PHP that I'm a little out of sorts with vb.
Here's what I have so far:
If the given weekday folder doesn't exist, this script works fine. But if the folder exists, I get an error 'Object required: 'C:\backup\Thursday'.' It doesn't delete the folder like I thought it should... Can anyone offer assistance, please?Code:dim dbcopy dim foldername dim killme foldername="C:\backup\"&weekdayname(weekday(day(date())))&"\" set dbcopy=CreateObject("Scripting.FileSystemObject") if dbcopy.FolderExists(foldername) then killme=dbcopy.GetFolder(foldername) killme.Delete end if dbcopy.CreateFolder(foldername) dbcopy.CopyFile "C:\Inetpub\wwwroot\_private\*.*", foldername
***EDIT***
I found the solution. I changed:
to:Code:killme=dbcopy.GetFolder(foldername) killme.Delete
And I had to remove the trailing &"\" from the foldername line. It didn't like that.Code:dbcopy.DeleteFolder(foldername)



LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks