davery83
11-24-2009, 03:27 AM
I've written a macro to remove roaming profiles from workstations (they're filling up the hard drive), its all working fine and I can delete all files and folders in each user profile except My Documents or the SendTo folder.
I get 'runtime error 70: permission denied'.
I've no idea how to set permissions with VBA or if it has something to do with admin rights, however I can delete this files manually with the same user I'm using to run the macro.
The folder has properties of read-only, however so does the other folders in the profile folder, and these can be deleted.
The code I've written skips the user if they are logged on (it checks ntuser.dat)to see if its open), so its not a problem with that either.
Can someone help please?
I get 'runtime error 70: permission denied'.
I've no idea how to set permissions with VBA or if it has something to do with admin rights, however I can delete this files manually with the same user I'm using to run the macro.
The folder has properties of read-only, however so does the other folders in the profile folder, and these can be deleted.
The code I've written skips the user if they are logged on (it checks ntuser.dat)to see if its open), so its not a problem with that either.
Can someone help please?