moving folders and files across network [modified]
-
Hello friends, In my MS access application,i want to move Subfolers from a folder across network using VBA. I used the below code to move subfolders and files from one folder to another. Dim fso, fld, subf Set fso = CreateObject("Scripting.FileSystemObject") Set fld = fso.GetFolder("C:\Hold\") For Each subf In fld.SubFolders subf.Move "c:\Data\" subf.Delete True Next Set fld = Nothing Set fso = Nothing But these won't work , if the folder is across network. Getting "permission denied" error.. How can i move subfolders and files across network
modified on Tuesday, November 18, 2008 3:12 AM
-
Hello friends, In my MS access application,i want to move Subfolers from a folder across network using VBA. I used the below code to move subfolders and files from one folder to another. Dim fso, fld, subf Set fso = CreateObject("Scripting.FileSystemObject") Set fld = fso.GetFolder("C:\Hold\") For Each subf In fld.SubFolders subf.Move "c:\Data\" subf.Delete True Next Set fld = Nothing Set fso = Nothing But these won't work , if the folder is across network. Getting "permission denied" error.. How can i move subfolders and files across network
modified on Tuesday, November 18, 2008 3:12 AM
jishbalan wrote:
But these won't work , if the folder is across network. Getting "permission denied" error..
Did you read the documentation on the FileSystemObject?? If not, I highly suggest doing so. You got the permission denied error either because you don't have write/create permissions in the target directory, or the target directory files/folders are ReadOnly and you're trying to overwrite them.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008