dseaver
IS-IT--Management
- Jul 13, 2006
- 467
I am trying to copy all the folders from documents and settings except for the default user, this is what I have, and it does not work
Code:
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CreateFolder "C:\cDrive"
fso.CreateFolder "C:\cDrive\Documents and Settings"
On Error Resume Next
Set FSO = CreateObject("Scripting.FileSystemObject")
ShowSubfolders FSO.GetFolder("C:\Documents and Settings")
Sub ShowSubFolders(Folder)
For Each Subfolder in Folder.SubFolders
If Subfolder.Name = "Default User" Then
Wscript.Echo "DEFAULT"
Else
Subfolder.Copy("C:\cDrive\Documents and Settings\")
End If
Next
End Sub