Grootte van subdirectorys remote computer

Author Message
Takamine

  • Total Posts : 3
  • Scores: 0
  • Reward points : 0
  • Joined: 1/17/2005
  • Location:
  • Status: offline
Grootte van subdirectorys remote computer Tuesday, March 08, 2005 12:49 AM (permalink)
0
Hallo,
Ik heb een vbscript gemaakt voor de groote van een subdirectorys weer te geven en deze vervolgens in een word-document te zetten.
Dit werkt echter alleen voor mijn locaal systeem.
Ik zou dit graag op een remote systeem willen uitvoeren.
Kan iemand mij daar misschien mee helpen.

Dim oFSO
Dim of
Dim oDrive
Dim sPath
Dim colFolders
Dim strComputer
Dim objWMIService


strComputer = InputBox("What Computer do you want to document (default=localhost)","Select Target",".")

Set objWMIService = GetObject("winmgmts:\" & strComputer & "rootcimv2")

Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()

Set objRange = objDoc.Range()
objDoc.Tables.Add objRange,1,2
Set objTable = objDoc.Tables(1)


x=1




sPath ="c:winnt"
Set oFSO = WScript.CreateObject("Scripting.FileSystemobject")
Set oF =oFSO.GetFolder(sPath)
Set colFolders = oF.SubFolders

'objSelection.TypeText "User data report"
For Each subFolder In colFolders

If x > 1 Then
objTable.Rows.Add()
End If
objTable.Cell(x, 1).Range.Text = Subfolder.Name
objTable.Cell(x, 2).Range.text = round(Subfolder.Size/1048576)
x = x + 1
Next


 
#1
    Zifter

    • Total Posts : 315
    • Scores: 0
    • Reward points : 0
    • Joined: 1/5/2005
    • Location: Belgium
    • Status: offline
    Re: Grootte van subdirectorys remote computer Tuesday, March 08, 2005 1:39 AM (permalink)
    0
    Hey Takamine,

    Only very few people who visit this forum understand dutch. In order to get answers to your questions, you beter describe your problem in english...

    [url="http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov04/hey1118.mspx"]This[/url] column of the Microsoft Scripting Guys handles about how to determine the size of a folder on a remote system.

    HTH
     
    #2
      token

      • Total Posts : 1917
      • Scores: 0
      • Reward points : 0
      • Joined: 1/14/2005
      • Location:
      • Status: offline
      Re: Grootte van subdirectorys remote computer Tuesday, March 08, 2005 6:11 AM (permalink)
      0
      To determine the size of a directory including all sub-directories, you could try the following.
      If the directory is located on a remote box, you could simply use the C$ admin share.
      =============================================================================================

      Option Explicit
      Dim fso, folder
      Set fso = CreateObject("Scripting.FileSystemObject")
      Set folder = fso.GetFolder("C:\Program Files")
      WScript.Echo folder.Size

      ======================================================

      Set folder = fso.GetFolder("\\server\c$\Program Files")
      WScript.Echo folder.Size

       
      #3

        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 1 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2012 ASPPlayground.NET Forum Version 3.9