Permission denied deleting a folder using VBScript
fso.DeleteFolder FolderSpec:="C:\MyDocuments", Force:=True
Although I think that can be done as:
fso.DeleteFolder "C:\MyDocuments", True
as opposed to using the named arguments (which I've never used in VBScript).
Did anybody ever figure this out?
Because I had the same problem.
I ran a script and I was logged in as administrator.
Why can you not delete or move if you are admin?
>you should run the script as the administor. If it is a
shared network drive, just run it from the server. If
not, create an icon on your desktop. In properties add
wscript in the target before the location of the script.
Then run the script by right mouse clicking and click
runas. That way you can run as an administrator. Or at
least that is what I have been told by others.
> Hi, I wrote this little script to delete a directory
every Friday that contains a bunch of junk (files and
folders posted by users). The code bellow seems to work in
testing. When I run it against a folder that contains a
read only file or a folder that my account doesn't have
permissions to it returns an Permission Denied error.
> How can I use a script to delete a directory full of
other directories and files, some of which I won't have
permissions to and some of which will be read only? I have
administrator rights on the Windows 2000 Server...
> Here's part of my script:
> Set oFso = CreateObject("Scripting.FileSystemObject")
> oFso.DeleteFolder("d:\xgigo"), 1