+ Post New Thread
Results 1 to 2 of 2
Coding Thread, local profiles script in Coding and Web Development; hi guys i have a script that im trying to run, it gets all local profile sizes for the person ...
  1. #1

    Join Date
    Dec 2012
    Posts
    3
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    local profiles script

    hi guys i have a script that im trying to run, it gets all local profile sizes for the person that it rns against, this works on xp current.y, not 7

    on win 7 i get following error:

    win 7 error.JPG


    ' You must provide the unc path of a shared folder .
    ' users must have write and modify permisions on t hat folder.

    Const MY_DOCUMENTS = &H5&
    Const ForReading = 1
    Const ForWriting = 2

    Dim WshNetwork, strUsername, strComputername, Description
    Dim objFolder, Drv, FilePath, strFile, FolderSize1, FolderSize2
    Set WshNetwork = WScript.CreateObject("WScript.Network") 

    'Output to share (type unc name of the shared fold er)
    FilePath = "\C:\localprf"

    strUsername = WshNetwork.UserName
    strComputername = WshNetwork.ComputerName

    Dim objFSO, strMY_DOCUMENTS, objFile' Global scopes
    Set objFSO = CreateObject("Scripting.FileSystemObject")

    WithCreateObject("Shell.Application").Namespace(MY_DOCUMENTS)
       strMY_DOCUMENTS = .Self.Path
       Set objFolder = objFSO.GetFolder(strMY_DOCUMENTS)
       drv = objFolder.drive
    EndWith

    ' Determine drivetype of the My Documents Fold er
    Description = strUsername & "'s Documents on "
    If (DriveIsLocal(drv) = True) Then
       Description = Description & strComputername
    Else
       Description = Description & "Fileserver"
    EndIf
    strFile = FilePath & "\" & Description & ".txt"

    ' convert byte to megabyte (1 megabyte = 1 048 576  byte)
    FolderSize1 = objFolder.Size' bytes
    FolderSize2 = RoundFormatNumber(FolderSize1/1048576, 2) ' megabytes



    really appreciate your help

    thanks
    Attached Images Attached Images
    Last edited by rhmphrey; 14th December 2012 at 02:48 PM.

  2. #2

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,323
    Thank Post
    903
    Thanked 1,801 Times in 1,550 Posts
    Blog Entries
    12
    Rep Power
    467
    You haven't posted the script



SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 9
    Last Post: 9th February 2012, 02:15 PM
  2. Deletion of local profiles on xp.
    By mac_shinobi in forum Scripts
    Replies: 25
    Last Post: 13th June 2007, 09:14 PM
  3. Replies: 17
    Last Post: 14th December 2006, 02:52 PM
  4. Replies: 9
    Last Post: 12th September 2006, 12:09 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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