I am trying to move a folder from a network location to a SharePoint site that I also have mapped as network folder using a vb script. The SharePoint site prompts for active directory credentials upon opening the network folder. I would also like to replace any existing folders on the SharePoint folder with the same name. Here is what I have so far:
dim filesys
persistent = false
set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "S:", "\\<sharepoint site>", persistent, "username ", "password"
set filesys=CreateObject("Scripting.FileSystemObject")
filesys.MoveFolder "C:\Documents\TestFolder", "S:\New Folder\"
When I try to run this, I get an error message stating "the local device name has a remembered connection to another network resource." Do I need to map the network connection each time the code is run? Any assistance is appreciated. Thanks!