1.

Solve : File to multible Folders.?

Answer»

Hi.

I've been lokkong AROUND and using the search function on the forum. But I've not found any thing
I could use. So this is my problem.

I've GOT a file that needs to be put in several useres folders. G:\Master\usres\*****\folderx\

I've used xcopy to copy the file to one user at the time but it takes for ever (500 users=*****)

Is there a WAY that I can automate it a bit.??

I've been looking for a solution along the lines of "dir \ /ad /b | find /v ":\RECYCLED" > user.txt"
to get all the user names but now I'm stuck.

Can I comebine the list with Xcopy.

HE Code: [Select]Option Explicit
Dim objFSO, objFolder
Dim root,Folders,FileToCopy,Destination
Set objFSO = CREATEOBJECT("Scripting.FileSystemObject")
root="G:\Master\users"
FileToCopy="c:\test\test.txt"
Set objFolder = objFSO.GetFolder(root)
For Each Folders In objFolder.SubFolders
Destination = Folders.Path&"\"&"folderx\"
If Not objFSO.FolderExists(Destination) Then
objFSO.CreateFolder(Destination)
End If
objFSO.CopyFile FileToCopy,Destination&"\"&"test.htm"
Next
save as myscript.vbs and run from command line : cscript /nologo myscript.vbs
For the batch solutoin, you have to use for loop and certain paramters...contrex or some others may be able to help you with that....HI ghostdog74.

You just made me a happy man.

My thanks to you.

HE.



Discussion

No Comment Found