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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MoveFolder Method across partitions

Status
Not open for further replies.

GstRdr1

MIS
May 29, 2002
17
US
I have a small application that uses the file system object and the move folder method. It works fine when moving between folders on the same partition but when I try to move from one to another I get a "run time error 70 Permission Denied." I can't find anything in MSDN do explain what is happening. I've checked the permissions on both drives and verified that they are set to everyone - full control. Is there a bug or an anomoly that I'm not thinking of? Or is there a better way to move folders programatically? Thanks in advance.

Marc
MCP -WinXP
-Win2k Server
 
I've not come across this myself and a quick test was okay.

Could you not just copy then delete?

Andy
"Logic is invincible because in order to combat logic it is necessary to use logic." -- Pierre Boutroux
"A computer program does what you tell it to do, not what you want it to do." -- Greer's Third Law
 
I've tried the CopyFolder method and it seems to only copy the contents of the folder instead of the folder itself. This is possible but it would require some recoding. You said that your quick test was ok? Is there anyway that you could let me know the OS you are working on? I'm running this on Win2k and everything tells me that this should work but it's not, I'm kind of baffled at the moment. Thanks for your quick response.

Marc
MCP -WinXP
-Win2k Server
 
I did it on a NT4.0 Server from C: to D:, using Visual Basic Editor in Outlook. However, as these two disks are part of a 50GB RAID, I'm not sure how valid the results are.

I used:
Code:
Private Sub FSO_Test()
  Dim fsoX As Scripting.FileSystemObject

  Set fsoX = New Scripting.FileSystemObject

  fsoX.CopyFolder "C:\Temp", "D:\Company Shared Folders\Temp"
End Sub
Hope this helps.

Andy
"Logic is invincible because in order to combat logic it is necessary to use logic." -- Pierre Boutroux
"A computer program does what you tell it to do, not what you want it to do." -- Greer's Third Law
 
That worked! [thumbsup2] I don't know what happened the first time I tried CopyFolder but oh well. Thank you for you help.

Marc
MCP -WinXP
-Win2k Server
 
GstRdr1

Hey, glad it worked!

Andy
"Logic is invincible because in order to combat logic it is necessary to use logic." -- Pierre Boutroux
"A computer program does what you tell it to do, not what you want it to do." -- Greer's Third Law
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top