Skip to main content

Vbs script to replace remote location files and verify


Copy and paste below code to notepad and change Location  and IP address of your environment

Code:-

DIM fso
Set fso=CreateObject("Scripting.FilesystemObject")
On Error Resume Next
fso.CopyFile "C:\Program Files\copy\Data\*.*", "\\10.111.11.11\c$\Program Files\paste\Data\"


strFile = "\\10.111.11.11\c$\Program Files\paste\Data\data1.txt"

Set objFSO = CreateObject("Scripting.FileSystemObject")
set objFile = objFSO.GetFile(strFile)
Wscript.Echo "File copy completed on Server 10.111.11.11: " &  CDate( objFile.DateLastModified)

Comments