p***@designexpress.eu
2016-05-05 07:01:59 UTC
I'm trying to delete a folder in the 'Program Files'. But I don't see why this wont work...
Here's the code I'm trying:
Sub DeleteAFolder(filespec)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder(filespec)
End Sub
DeleteAFolder("C:\Program Files\TestFolder")
Result: "Permission denied"
I also tried:
Sub DeleteAFolder(filespec)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder(filespec)
End Sub
DeleteAFolder("""C:\Program Files\TestFolder""")
Result: "Path not found"
Any ideas?
Here's the code I'm trying:
Sub DeleteAFolder(filespec)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder(filespec)
End Sub
DeleteAFolder("C:\Program Files\TestFolder")
Result: "Permission denied"
I also tried:
Sub DeleteAFolder(filespec)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder(filespec)
End Sub
DeleteAFolder("""C:\Program Files\TestFolder""")
Result: "Path not found"
Any ideas?