VBS权限错误

时间:2017-08-02 20:03:54

标签: vbscript

Dim strFile2 = User & "\Documents"
Dim objFSO2 = CreateObject("Scripting.FileSystemObject")
Dim Documents = objFSO2.GetFolder(strFile2)
Documents = CDec(Documents.Size / bytesToGb)
MsgBox(Documents)

错误:

Screenshot

System.Security.SecurityException occurred HResult=-2146828218
  Message=Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED)
  Source="" StackTrace: 
    at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(O‌​bject o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
    at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGe‌​t(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)         
    at ExportImport.Form1.Export_Click(Object sender, EventArgs e) 
 in C:\Users\admin\Desktop\Export Import\ExportImport\ExportImport\Form1.vb:line 42 
InnerException:

此声明提供错误:

Documents = CDec(Documents.Size / bytesToGb)

我很好奇是否有解决此错误的方法或解决方法。

0 个答案:

没有答案