rhmphrey Posted December 14, 2012 Posted December 14, 2012 (edited) 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: ' You must provide the unc path of a shared folder. ' users must have write and modify permisions on that 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 folder) FilePath = "\C:\localprf" strUsername = WshNetwork.UserName strComputername = WshNetwork.ComputerName Dim objFSO, strMY_DOCUMENTS, objFile ' Global scopes Set objFSO = CreateObject("Scripting.FileSystemObject") With CreateObject("Shell.Application").Namespace(MY_DOCUMENTS) strMY_DOCUMENTS = .Self.Path Set objFolder = objFSO.GetFolder(strMY_DOCUMENTS) drv = objFolder.drive End With ' Determine drivetype of the My Documents Folder Description = strUsername & "'s Documents on " If (DriveIsLocal(drv) = True) Then Description = Description & strComputername Else Description = Description & "Fileserver" End If 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 Edited December 14, 2012 by rhmphrey
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now