>Oh, I wasn't going anywhere near optimising the current code any further just yet ...
Well you wont have to, I turned to Experts Exchange and they were really helpful and very NICE to work with.
I guess it does pay to purchase a subscription.
Okay, I finally got that. So I did that and it is kinda working now. Here is the code.
Option Explicit
On Error Resume Next
Dim objFSO, objInFile, objItem, objItem2, objOutFile, strFile, strOutData, strOutFile, strNoData
Dim strComputer, strModel, strUsername, strMacaddress, strSvcTag...
I think you are not understanding the whole picture just part of it. I understand your code will ping the computer but it does not return the pc is not pinging and goes to the next computer. When your code is put in the script it does ping it but when there is a pc not on the network it does...
Well I have about 4000 computers to run this script on. When it gets to a pc that is not on the network, i.e. turned off, renamed or something to that effect it pings it and times out 4 times. So if there is about 20 or 30 computers in a row that do not ping then it takes a long time for the...
Okay when I implement that coding into the script I have it takes forever to run. Also this kinda of hard to explain but I want it to skip it and write out something line pc not online or pinging something to that sort. The reason I want it to skip it because when I run it and the pc is not...
I have a script that reads a txt file line by line a list of hostnames. Then it pipes out certain info from that pc to a csv file. When it gets to a hostname that is not on the network or not pinging it takes a while and pipes out the info of the last pc that was pinging. Can someone help me...
I finally got it working.
Here is the code.
Option Explicit
On Error Resume Next
Dim objFSO, objInFile, objItem, objItem2, objOutFile, strFile, strOutData, strOutFile
Dim strComputer, strModel, strUsername, strMacaddress, strSvcTag, strIPAddress
Dim objWMIService, colItems, colItems2...
When I do that I get the error
Object required: "
Here is where I put it.
strOutData = strComputer & "|" & strIPAddress & "|" & strSvcTag & "|" & strModel & "|" & strUsername & "|" & strMacaddress & vbCrLf
objOutFile.Write strOutData
Loop
Set objOutFile =...
Jges,
Wow, I am at a lost now. I see what it is doing now. I am no where near an expert at this VB stuff. I am just at a lost now. Should I remove the FOR loops then?
Okay so maybe I am still missing something. Here is what I have:
Option Explicit
Dim objFSO, objInFile, objItem, objItem2, objOutFile, strFile, strOutData, strOutFile
Dim strComputer, strModel, strUsername, strMacaddress, strSvcTag, strIPAddress
Dim objWMIService, colItems, colItems2...
Okay I have put the option explicit in there but when I run it, it still only outputs the last entry in the csv from the text file. I need it to output all computers I have listed in the txt file. Here is what I have now.
Option Explicit
Dim objFSO, objInFile, objItem, objItem2, objOutFile...
I have a script that reads a txt file line by line and then outputs to a CSV file. The issue I am having is when I run the script and I have multiple hostnames in the txt file it only pipes out the last hostname in the list to the csv file. Does anyone know how to modify this to pipe out all the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.