D
David C
I am using the MoveDirectory method to move a folder and all of its
subfolders and files to another location but it does not work. It only
copies the source to the destination. Is there a method that will
physically move the designated folder, subfolders and files from source to
destination? Below is my code. Thanks.
David
strListFolderPath = strListFolderPath & strAddress
strListFolderPath = Server.MapPath(strListFolderPath)
strExpFolderPath = strExpFolderPath & strAddress
strExpFolderPath = Server.MapPath(strExpFolderPath)
If
My.Computer.FileSystem.DirectoryExists(strListFolderPath) = True Then
'Move all current listings folders to the expired
listing folder
My.Computer.FileSystem.MoveDirectory(strListFolderPath,
strExpFolderPath, True)
txtMsg.Text += "The current listings folders were
moved to the EXPIRED AND DEAD LISTINGS folder."
If
My.Computer.FileSystem.DirectoryExists(strExpFolderPath) = False Then
'No current expired folder exists for the
listing so create it
My.Computer.FileSystem.CreateDirectory(strExpFolderPath)
End If
End If
subfolders and files to another location but it does not work. It only
copies the source to the destination. Is there a method that will
physically move the designated folder, subfolders and files from source to
destination? Below is my code. Thanks.
David
strListFolderPath = strListFolderPath & strAddress
strListFolderPath = Server.MapPath(strListFolderPath)
strExpFolderPath = strExpFolderPath & strAddress
strExpFolderPath = Server.MapPath(strExpFolderPath)
If
My.Computer.FileSystem.DirectoryExists(strListFolderPath) = True Then
'Move all current listings folders to the expired
listing folder
My.Computer.FileSystem.MoveDirectory(strListFolderPath,
strExpFolderPath, True)
txtMsg.Text += "The current listings folders were
moved to the EXPIRED AND DEAD LISTINGS folder."
If
My.Computer.FileSystem.DirectoryExists(strExpFolderPath) = False Then
'No current expired folder exists for the
listing so create it
My.Computer.FileSystem.CreateDirectory(strExpFolderPath)
End If
End If