I have a HTA and I need it to list folder size for things such as documents, videos, downloads ect..
I have this VBS section that works on any folder except things like documents where I get access denied, I am trying to get this working on windows 7
dim FSO, objFolder,datafolder, foldername
foldername = strHomeFolder+"\Documents"
msgBox(foldername)
Set fso= CreateObject("Scripting.FileSystemObject")
If fso.FolderExists(foldername ) Then
Set objFolder= FSO.GetFolder(foldername ) 'getting folder size objFolder.Size\par
ShowFolderDetails objFolder
Sub ShowFolderDetails(oF)
datafolder = oF.Size
End sub
docSize = datafolder
End If
msgBox(docSize)
docSize = docSize / 1024
docSize = docSize / 1024
docSize = docSize / 1024
docSize = Round(docSize,1)
Why does this return access denied? It is a local folder and the user account is an administrator, I have even tried running the HTA as administrator still to no avail.