Renaming a windows folder

  • Thread starter Thread starter John Baker
  • Start date Start date
J

John Baker

I am looking for a method or code to rename folders in windows directly
using VBA or some other method while in Access.

Any help greatly appreciated.

John B
 
Public Sub CreateAndRenameFolder()

On Error Resume Next

'careful with this - make sure
'you don't have folders with
'these names that you don't
'want to mess with.
RmDir "C:\TestFolder"
RmDir "C:\RenamedFolder"

On Error GoTo 0
MkDir "C:\TestFolder"
Name "C:\TestFolder" As "C:\RenamedFolder"

End Sub
 
Thanks for your reply Brendan. I used the "Name as" code and it worked
beautifully.

Cheers
John.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top