| |
ztruelove
Posts: 2
Score: 0
Joined: 3/2/2008
Status: offline
|
I am trying to use a vbscript on an XP machine to copy a particular folder into each profile under "Documents and Settings." Below is a script that I wrote trying to accomplish that... '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Option Explicit 'On Error Resume Next Const USERPROFILE = 40 Dim objShell, objFSO, objUser, objDocsAndSettings, objUserProfile Dim sUserProfile Set objShell = CreateObject("Shell.Application") Set objFSO = CreateObject("Scripting.FileSystemObject") sUserProfile = objShell.Namespace(USERPROFILE).self.path Set objUserProfile = objFSO.GetFolder(sUserProfile) Set objDocsAndSettings = objFSO.GetFolder(objUserProfile.ParentFolder) For Each objUser In objDocsAndSettings.SubFolders objFSO.CopyFolder "C:\Documents and Settings\All Users\Start Menu\Programs\Ipswitch WS_FTP Professional", _ objUser.Path & "\Start Menu\Programs\Ipswitch WS_FTP Professional" Next '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' The problem is that the CopyFolder method isn't recognizing the destination since it includes objUser.Path. Again, I can get the basic functionality of the method to work fine; the problem arises from the fact that I need to perform this copy on each and every profile under "Documents and Settings." Any suggestions on how to accomplish what I'm looking for?
|
|