Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.
Const ComputersList = "C:\sysadmin\CopyFilesPcList.txt" Const SourceFile = "C:\sysadmin\Isolations.url" Const TargetFolder = "C:sysadmin\" Const ReportFile = "C:\sysadmin\CopyFilesLog.txt" Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject") Dim objFile : Set objFile = objFSO.CreateTextFile (ReportFile) arrComputers = Split(objFSO.OpenTextFile(ComputersList).ReadAll, vbNewLine) For Each PC in arrComputers objFile.WriteLine "Attempting copy to " & PC On Error Resume Next objFSO.CopyFile SourceFile, "\\" & PC & "\" & Replace(TargetFolder, ":\","$\") If Err.Number <> 0 Then objFile.WriteLine vbTab & "Failed to copy to " & PC" Else objFile.WriteLine vbTab & "File successfully copied to " & PC End If On Error Goto 0 Next objFile.Close
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.