FileSystemObject - Need help.

Results 1 to 3 of 3

Thread: FileSystemObject - Need help.

  1. #1
    Darren D. Guest

    Default FileSystemObject - Need help.

    OK, I must be missing something, all I&#039;m trying to do is pull a path that is stored in a database of a folder that I want to get the size of.<BR><BR>Here is the code:<BR><BR>&#060;%<BR>Dim FolderPath<BR>FolderPath = objRS("path")<BR> <BR>Set objFSO = Server.CreateObject("Scripting.FileSystemObject")< BR>Set objFolder = objFSO.GetFolder(FolderPath)<BR>Set objFolderSize = objFolder.Size<BR><BR>%&#062;<BR><BR>Then I display with: &#060;%=objFolderSize%&#062;<BR><BR>And I get this error:<BR><BR>Error Type:<BR>Microsoft VBScript runtime (0x800A01A8)<BR>Object required: &#039;[number: 2403211]&#039;<BR>/index.asp, line 99<BR><BR>Facts: Line 99 is "Set objFolderSize = objFolder.Size" and the number it displays in the error is, in fact, the size in bytes of the folder.<BR><BR>Am I not formatting the datatype correctly for display? Keep in mind I want to add this number later to something else.<BR><BR>Thanks,<BR><BR>Darren

  2. #2
    J Guest

    Default RE: FileSystemObject - Need help.

    i don&#039;t think you need to use the SET keyword, because objFolder.Size is not an object, but rather a value...try...<BR><BR>dim foldersize<BR>foldersize = objFolder.Size

  3. #3
    Darren D. Guest

    Default RE: FileSystemObject - Need help.

    You people so rock. And a response time of 3 minutes? Amazing.<BR><BR>Thanks,<BR>Darren

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts