title: Vbs read from txt file and return data
body: <p>I need a script that reads from a txt file (a computer list) and returns how much time do we have before the Daylight savings starts.</p>
  
  <p>Here's my script so far:</p>
  
  <pre><code>strComputer = "C:\temp\computerlist.txt"
  
  For Each computer in strComputer
  
  For Each objItem in colItems
      Set objWMIService = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")
      Set colItems = objWMIService.ExecQuery("Select * From Win32_LocalTime")
      strTime = objItem.Hour &amp; ":" &amp; objItem.Minute &amp; ":" &amp; objItem.Second
      dtmTime = CDate(strTime)
      Wscript.Echo FormatDateTime(dtmTime, vbFormatLongTime)
  Next
  Next
  
  DayLightSavingTimes=CDate("21/10/2013 00:00:00")
  
  
  wscript.echo("It is " &amp; DateDiff("m", Now(), DayLightSavingTimes) &amp; " Months to the DayLightSavingTimes!")
  wscript.echo("It is " &amp;  DateDiff("d", Now(), DayLightSavingTimes) &amp; " days to the DayLightSavingTimes!")
  wscript.echo("It is " &amp; DateDiff("h", Now(), DayLightSavingTimes) &amp; " hours to the DayLightSavingTimes!")
  wscript.echo("It is " &amp; DateDiff("n", Now(), DayLightSavingTimes) &amp; " Minutes to the DayLightSavingTimes!")
  wscript.echo("It is " &amp; DateDiff("s", Now(), DayLightSavingTimes) &amp; " seconds to the DayLightSavingTimes!")
  </code></pre>
  
  <p>When I ran this for one single computer it works:</p>
  
  <pre><code>strComputer = "MyComputer"
  WScript.Echo "Running Against Remote Computer Named: " &amp; strComputer
  
  Set objWMIService = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")
  Set colItems = objWMIService.ExecQuery("Select * From Win32_LocalTime")
  
  For Each objItem in colItems
      strTime = objItem.Hour &amp; ":" &amp; objItem.Minute &amp; ":" &amp; objItem.Second
      dtmTime = CDate(strTime)
      Wscript.Echo FormatDateTime(dtmTime, vbFormatLongTime)
  Next
  
  
  DayLightSavingTimes=CDate("21/10/2013 00:00:00")
  
  
  wscript.echo("It is " &amp; DateDiff("m", Now(), DayLightSavingTimes) &amp; " Months to the DayLightSavingTimes!")
  wscript.echo("It is " &amp;  DateDiff("d", Now(), DayLightSavingTimes) &amp; " days to the DayLightSavingTimes!")
  wscript.echo("It is " &amp; DateDiff("h", Now(), DayLightSavingTimes) &amp; " hours to the DayLightSavingTimes!")
  wscript.echo("It is " &amp; DateDiff("n", Now(), DayLightSavingTimes) &amp; " Minutes to the DayLightSavingTimes!")
  wscript.echo("It is " &amp; DateDiff("s", Now(), DayLightSavingTimes) &amp; " seconds to the DayLightSavingTimes!")
  </code></pre>
  
  <p>And I get the expected results:</p>
  
  <pre><code>Running Against Remote Computer Named: MyComputer
  14:28:22
  It is 0 Months to the DayLightSavingTimes!
  It is 3 days to the DayLightSavingTimes!
  It is 58 hours to the DayLightSavingTimes!
  It is 3452 Minutes to the DayLightSavingTimes!
  It is 207098 seconds to the DayLightSavingTimes!
  </code></pre>
  
  <p>I need to get the same results running this on remote machines, stored on computerlist.txt
  The error I get running it remotely is <strong>Microsoft VBScript runtime error: Object not a collection.</strong></p>
  
  <p>Any hints?</p>
  
  <p>Thanks</p>