Hi I have wrote this code to copy the file by reading the text file with bunch of computer name si n it and pick the associated file from my c drive and copy on to destination computer with a common name,
I need some error handling solution so if the code is unable to reach the destination computer then it must log the error in a separate file with just computer name and continue with the rest of the list.
I am able to copy the file successfully if the computer is on but when its not reachable the whole code failes PLEASE HELP EXPERTS
Const ForReading = 1
Const OverwriteExisting = True
'constants defined we next create an instance to open the first file
Set objFSO = CreateObject("Scripting.Fi
Set objFile = objFSO.OpenTextFile("C:\Co
' With the text file open next step is to read through the first file line-by-line until we’ve reached the end of the file
Do Until objFile.AtEndOfStream
strComputer = objFile.ReadLine
' constructing a UNC path, & new file name at destination substituting the value of the variable strComputer for the computer name
strRemoteFile = "\\" & strComputer & "\C$\CONFIG.TXT"
strRemoteEXE = "\\" & strComputer & "\C$\BiosConfigUtility.EXE
' constructing a UNC path, substituting the value of the variable strFile for the Source File name
strSourceFile = "\\holit126\Temp\" & strComputer & ".txt"
objFSO.CopyFile strSourceFile, strRemoteFile, OverwriteExisting
XE", strRemoteEXE, OverwriteExisting
MsgBox ("gone through")
HOLIT126.txt UNLGTCC001.txt Computers.txt Copy-of-Autocopy-new.txt