First of all thank you for reading my post. Recently Razor2.3 really helped me in creating batch file to disable windows service it was very helpful and I am back with another request to make my daily job more automated.
0. Every run should display date time and append log...
1. Ping 500 remote computers listed under computerlist.txt and
2. Use VBScript to search for file under C:\temp\abc.txt on remote pc if it's online
3. If file doesn't exist then have output in logfile to notify us (most important)
We can also have some advanced option of using xcopy to copy 15MB file on remote pc but I wasn't sure about result if remote pc shutdown in between copy or can we use something like bits admin?
If using xcopy is too much then can always start manual copying of file over network.
I have got below code which only works with single pc and does echo if file exist:
( Ref: http://blogs.technet.com/b/heyscrip...
strComputer = "atl-fs-01"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService. _
ExecQuery("Select * From CIM_DataFile Where Name = 'C:\\Scripts\\Test.vbs'")
If colFiles.Count = 0 Then
Wscript.Echo "The file does not exist on the remote computer."
Wscript.Echo "The file exists on the remote computer."